diff --git a/beacon-chain/db/kv/migration_state_validators.go b/beacon-chain/db/kv/migration_state_validators.go index fb08b5d43aec..38cd6f242621 100644 --- a/beacon-chain/db/kv/migration_state_validators.go +++ b/beacon-chain/db/kv/migration_state_validators.go @@ -130,9 +130,15 @@ func performValidatorStateMigration(ctx context.Context, bar *progressbar.Progre return err } item := enc - if hasAltairKey(item) { + switch { + case hasAltairKey(enc): item = item[len(altairKey):] + case hasBellatrixKey(enc): + item = item[len(bellatrixKey):] + case hasCapellaKey(enc): + item = item[len(capellaKey):] } + detector, err := detect.FromState(item) if err != nil { return err @@ -165,9 +171,14 @@ func performValidatorStateMigration(ctx context.Context, bar *progressbar.Progre return err } var stateBytes []byte - if hasAltairKey(enc) { + switch { + case hasAltairKey(enc): stateBytes = snappy.Encode(nil, append(altairKey, rawObj...)) - } else { + case hasBellatrixKey(enc): + stateBytes = snappy.Encode(nil, append(bellatrixKey, rawObj...)) + case hasCapellaKey(enc): + stateBytes = snappy.Encode(nil, append(capellaKey, rawObj...)) + default: stateBytes = snappy.Encode(nil, rawObj) } if stateErr := stateBkt.Put(keys[index], stateBytes); stateErr != nil { diff --git a/beacon-chain/db/kv/migration_state_validators_test.go b/beacon-chain/db/kv/migration_state_validators_test.go index 78cf03fe8518..9f4cb6db124f 100644 --- a/beacon-chain/db/kv/migration_state_validators_test.go +++ b/beacon-chain/db/kv/migration_state_validators_test.go @@ -313,3 +313,217 @@ func Test_migrateAltairStateValidators(t *testing.T) { }) } } + +func Test_migrateBellatrixStateValidators(t *testing.T) { + tests := []struct { + name string + setup func(t *testing.T, dbStore *Store, state state.BeaconState, vals []*v1alpha1.Validator) + eval func(t *testing.T, dbStore *Store, state state.BeaconState, vals []*v1alpha1.Validator) + }{ + { + name: "migrates validators and adds them to new buckets", + setup: func(t *testing.T, dbStore *Store, state state.BeaconState, vals []*v1alpha1.Validator) { + // create some new buckets that should be present for this migration + err := dbStore.db.Update(func(tx *bbolt.Tx) error { + _, err := tx.CreateBucketIfNotExists(stateValidatorsBucket) + assert.NoError(t, err) + _, err = tx.CreateBucketIfNotExists(blockRootValidatorHashesBucket) + assert.NoError(t, err) + return nil + }) + assert.NoError(t, err) + }, + eval: func(t *testing.T, dbStore *Store, state state.BeaconState, vals []*v1alpha1.Validator) { + // check whether the new buckets are present + err := dbStore.db.View(func(tx *bbolt.Tx) error { + valBkt := tx.Bucket(stateValidatorsBucket) + assert.NotNil(t, valBkt) + idxBkt := tx.Bucket(blockRootValidatorHashesBucket) + assert.NotNil(t, idxBkt) + return nil + }) + assert.NoError(t, err) + + // check if the migration worked + blockRoot := [32]byte{'A'} + rcvdState, err := dbStore.State(context.Background(), blockRoot) + assert.NoError(t, err) + require.DeepSSZEqual(t, rcvdState.ToProtoUnsafe(), state.ToProtoUnsafe(), "saved state with validators and retrieved state are not matching") + + // find hashes of the validators that are set as part of the state + var hashes []byte + var individualHashes [][]byte + for _, val := range vals { + hash, hashErr := val.HashTreeRoot() + assert.NoError(t, hashErr) + hashes = append(hashes, hash[:]...) + individualHashes = append(individualHashes, hash[:]) + } + + // check if all the validators that were in the state, are stored properly in the validator bucket + pbState, err := state_native.ProtobufBeaconStateBellatrix(rcvdState.ToProtoUnsafe()) + assert.NoError(t, err) + validatorsFoundCount := 0 + for _, val := range pbState.Validators { + hash, hashErr := val.HashTreeRoot() + assert.NoError(t, hashErr) + found := false + for _, h := range individualHashes { + if bytes.Equal(hash[:], h) { + found = true + } + } + require.Equal(t, true, found) + validatorsFoundCount++ + } + require.Equal(t, len(vals), validatorsFoundCount) + + // check if the state validator indexes are stored properly + err = dbStore.db.View(func(tx *bbolt.Tx) error { + rcvdValhashBytes := tx.Bucket(blockRootValidatorHashesBucket).Get(blockRoot[:]) + rcvdValHashes, sErr := snappy.Decode(nil, rcvdValhashBytes) + assert.NoError(t, sErr) + require.DeepEqual(t, hashes, rcvdValHashes) + return nil + }) + assert.NoError(t, err) + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + dbStore := setupDB(t) + + // add a state with the given validators + vals := validators(10) + blockRoot := [32]byte{'A'} + st, _ := util.DeterministicGenesisStateBellatrix(t, 20) + err := st.SetFork(&v1alpha1.Fork{ + PreviousVersion: params.BeaconConfig().AltairForkVersion, + CurrentVersion: params.BeaconConfig().BellatrixForkVersion, + Epoch: 0, + }) + require.NoError(t, err) + assert.NoError(t, st.SetSlot(100)) + assert.NoError(t, st.SetValidators(vals)) + assert.NoError(t, dbStore.SaveState(context.Background(), st, blockRoot)) + + // enable historical state representation flag to test this + resetCfg := features.InitWithReset(&features.Flags{ + EnableHistoricalSpaceRepresentation: true, + }) + defer resetCfg() + + tt.setup(t, dbStore, st, vals) + assert.NoError(t, migrateStateValidators(context.Background(), dbStore.db), "migrateArchivedIndex(tx) error") + tt.eval(t, dbStore, st, vals) + }) + } +} + +func Test_migrateCapellaStateValidators(t *testing.T) { + tests := []struct { + name string + setup func(t *testing.T, dbStore *Store, state state.BeaconState, vals []*v1alpha1.Validator) + eval func(t *testing.T, dbStore *Store, state state.BeaconState, vals []*v1alpha1.Validator) + }{ + { + name: "migrates validators and adds them to new buckets", + setup: func(t *testing.T, dbStore *Store, state state.BeaconState, vals []*v1alpha1.Validator) { + // create some new buckets that should be present for this migration + err := dbStore.db.Update(func(tx *bbolt.Tx) error { + _, err := tx.CreateBucketIfNotExists(stateValidatorsBucket) + assert.NoError(t, err) + _, err = tx.CreateBucketIfNotExists(blockRootValidatorHashesBucket) + assert.NoError(t, err) + return nil + }) + assert.NoError(t, err) + }, + eval: func(t *testing.T, dbStore *Store, state state.BeaconState, vals []*v1alpha1.Validator) { + // check whether the new buckets are present + err := dbStore.db.View(func(tx *bbolt.Tx) error { + valBkt := tx.Bucket(stateValidatorsBucket) + assert.NotNil(t, valBkt) + idxBkt := tx.Bucket(blockRootValidatorHashesBucket) + assert.NotNil(t, idxBkt) + return nil + }) + assert.NoError(t, err) + + // check if the migration worked + blockRoot := [32]byte{'A'} + rcvdState, err := dbStore.State(context.Background(), blockRoot) + assert.NoError(t, err) + require.DeepSSZEqual(t, rcvdState.ToProtoUnsafe(), state.ToProtoUnsafe(), "saved state with validators and retrieved state are not matching") + + // find hashes of the validators that are set as part of the state + var hashes []byte + var individualHashes [][]byte + for _, val := range vals { + hash, hashErr := val.HashTreeRoot() + assert.NoError(t, hashErr) + hashes = append(hashes, hash[:]...) + individualHashes = append(individualHashes, hash[:]) + } + + // check if all the validators that were in the state, are stored properly in the validator bucket + pbState, err := state_native.ProtobufBeaconStateCapella(rcvdState.ToProtoUnsafe()) + assert.NoError(t, err) + validatorsFoundCount := 0 + for _, val := range pbState.Validators { + hash, hashErr := val.HashTreeRoot() + assert.NoError(t, hashErr) + found := false + for _, h := range individualHashes { + if bytes.Equal(hash[:], h) { + found = true + } + } + require.Equal(t, true, found) + validatorsFoundCount++ + } + require.Equal(t, len(vals), validatorsFoundCount) + + // check if the state validator indexes are stored properly + err = dbStore.db.View(func(tx *bbolt.Tx) error { + rcvdValhashBytes := tx.Bucket(blockRootValidatorHashesBucket).Get(blockRoot[:]) + rcvdValHashes, sErr := snappy.Decode(nil, rcvdValhashBytes) + assert.NoError(t, sErr) + require.DeepEqual(t, hashes, rcvdValHashes) + return nil + }) + assert.NoError(t, err) + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + dbStore := setupDB(t) + + // add a state with the given validators + vals := validators(10) + blockRoot := [32]byte{'A'} + st, _ := util.DeterministicGenesisStateCapella(t, 20) + err := st.SetFork(&v1alpha1.Fork{ + PreviousVersion: params.BeaconConfig().BellatrixForkVersion, + CurrentVersion: params.BeaconConfig().CapellaForkVersion, + Epoch: 0, + }) + require.NoError(t, err) + assert.NoError(t, st.SetSlot(100)) + assert.NoError(t, st.SetValidators(vals)) + assert.NoError(t, dbStore.SaveState(context.Background(), st, blockRoot)) + + // enable historical state representation flag to test this + resetCfg := features.InitWithReset(&features.Flags{ + EnableHistoricalSpaceRepresentation: true, + }) + defer resetCfg() + + tt.setup(t, dbStore, st, vals) + assert.NoError(t, migrateStateValidators(context.Background(), dbStore.db), "migrateArchivedIndex(tx) error") + tt.eval(t, dbStore, st, vals) + }) + } +} diff --git a/beacon-chain/rpc/eth/debug/debug.go b/beacon-chain/rpc/eth/debug/debug.go index 493108f16af0..af6361bda8f5 100644 --- a/beacon-chain/rpc/eth/debug/debug.go +++ b/beacon-chain/rpc/eth/debug/debug.go @@ -104,6 +104,18 @@ func (ds *Server) GetBeaconStateV2(ctx context.Context, req *ethpbv2.BeaconState ExecutionOptimistic: isOptimistic, Finalized: isFinalized, }, nil + case version.Deneb: + protoState, err := migration.BeaconStateDenebToProto(beaconSt) + if err != nil { + return nil, status.Errorf(codes.Internal, "Could not convert state to proto: %v", err) + } + return ðpbv2.BeaconStateResponseV2{ + Version: ethpbv2.Version_DENEB, + Data: ðpbv2.BeaconStateContainer{ + State: ðpbv2.BeaconStateContainer_DenebState{DenebState: protoState}, + }, + ExecutionOptimistic: isOptimistic, + }, nil default: return nil, status.Error(codes.Internal, "Unsupported state version") } @@ -133,6 +145,8 @@ func (ds *Server) GetBeaconStateSSZV2(ctx context.Context, req *ethpbv2.BeaconSt ver = ethpbv2.Version_BELLATRIX case version.Capella: ver = ethpbv2.Version_CAPELLA + case version.Deneb: + ver = ethpbv2.Version_DENEB default: return nil, status.Error(codes.Internal, "Unsupported state version") } diff --git a/beacon-chain/rpc/eth/debug/debug_test.go b/beacon-chain/rpc/eth/debug/debug_test.go index 7c772e89baef..5d7a75bffe49 100644 --- a/beacon-chain/rpc/eth/debug/debug_test.go +++ b/beacon-chain/rpc/eth/debug/debug_test.go @@ -97,6 +97,24 @@ func TestGetBeaconStateV2(t *testing.T) { assert.NotNil(t, resp) assert.Equal(t, ethpbv2.Version_CAPELLA, resp.Version) }) + t.Run("Deneb", func(t *testing.T) { + fakeState, _ := util.DeterministicGenesisStateDeneb(t, 1) + server := &Server{ + Stater: &testutil.MockStater{ + BeaconState: fakeState, + }, + HeadFetcher: &blockchainmock.ChainService{}, + OptimisticModeFetcher: &blockchainmock.ChainService{}, + FinalizationFetcher: &blockchainmock.ChainService{}, + BeaconDB: db, + } + resp, err := server.GetBeaconStateV2(context.Background(), ðpbv2.BeaconStateRequestV2{ + StateId: []byte("head"), + }) + require.NoError(t, err) + assert.NotNil(t, resp) + assert.Equal(t, ethpbv2.Version_DENEB, resp.Version) + }) t.Run("execution optimistic", func(t *testing.T) { parentRoot := [32]byte{'a'} blk := util.NewBeaconBlock() @@ -256,6 +274,25 @@ func TestGetBeaconStateSSZV2(t *testing.T) { assert.DeepEqual(t, sszState, resp.Data) assert.Equal(t, ethpbv2.Version_CAPELLA, resp.Version) }) + t.Run("Deneb", func(t *testing.T) { + fakeState, _ := util.DeterministicGenesisStateDeneb(t, 1) + sszState, err := fakeState.MarshalSSZ() + require.NoError(t, err) + + server := &Server{ + Stater: &testutil.MockStater{ + BeaconState: fakeState, + }, + } + resp, err := server.GetBeaconStateSSZV2(context.Background(), ðpbv2.BeaconStateRequestV2{ + StateId: make([]byte, 0), + }) + require.NoError(t, err) + assert.NotNil(t, resp) + + assert.DeepEqual(t, sszState, resp.Data) + assert.Equal(t, ethpbv2.Version_DENEB, resp.Version) + }) } func TestListForkChoiceHeadsV2(t *testing.T) { diff --git a/proto/eth/v2/beacon_state.pb.go b/proto/eth/v2/beacon_state.pb.go index 25474da85928..40b69f080fa0 100755 --- a/proto/eth/v2/beacon_state.pb.go +++ b/proto/eth/v2/beacon_state.pb.go @@ -759,6 +759,269 @@ func (x *BeaconStateCapella) GetHistoricalSummaries() []*HistoricalSummary { return nil } +type BeaconStateDeneb struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GenesisTime uint64 `protobuf:"varint,1001,opt,name=genesis_time,json=genesisTime,proto3" json:"genesis_time,omitempty"` + GenesisValidatorsRoot []byte `protobuf:"bytes,1002,opt,name=genesis_validators_root,json=genesisValidatorsRoot,proto3" json:"genesis_validators_root,omitempty" ssz-size:"32"` + Slot github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot `protobuf:"varint,1003,opt,name=slot,proto3" json:"slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"` + Fork *v1.Fork `protobuf:"bytes,1004,opt,name=fork,proto3" json:"fork,omitempty"` + LatestBlockHeader *v1.BeaconBlockHeader `protobuf:"bytes,2001,opt,name=latest_block_header,json=latestBlockHeader,proto3" json:"latest_block_header,omitempty"` + BlockRoots [][]byte `protobuf:"bytes,2002,rep,name=block_roots,json=blockRoots,proto3" json:"block_roots,omitempty" ssz-size:"8192,32"` + StateRoots [][]byte `protobuf:"bytes,2003,rep,name=state_roots,json=stateRoots,proto3" json:"state_roots,omitempty" ssz-size:"8192,32"` + HistoricalRoots [][]byte `protobuf:"bytes,2004,rep,name=historical_roots,json=historicalRoots,proto3" json:"historical_roots,omitempty" ssz-max:"16777216" ssz-size:"?,32"` + Eth1Data *v1.Eth1Data `protobuf:"bytes,3001,opt,name=eth1_data,json=eth1Data,proto3" json:"eth1_data,omitempty"` + Eth1DataVotes []*v1.Eth1Data `protobuf:"bytes,3002,rep,name=eth1_data_votes,json=eth1DataVotes,proto3" json:"eth1_data_votes,omitempty" ssz-max:"2048"` + Eth1DepositIndex uint64 `protobuf:"varint,3003,opt,name=eth1_deposit_index,json=eth1DepositIndex,proto3" json:"eth1_deposit_index,omitempty"` + Validators []*v1.Validator `protobuf:"bytes,4001,rep,name=validators,proto3" json:"validators,omitempty" ssz-max:"1099511627776"` + Balances []uint64 `protobuf:"varint,4002,rep,packed,name=balances,proto3" json:"balances,omitempty" ssz-max:"1099511627776"` + RandaoMixes [][]byte `protobuf:"bytes,5001,rep,name=randao_mixes,json=randaoMixes,proto3" json:"randao_mixes,omitempty" ssz-size:"65536,32"` + Slashings []uint64 `protobuf:"varint,6001,rep,packed,name=slashings,proto3" json:"slashings,omitempty" ssz-size:"8192"` + PreviousEpochParticipation []byte `protobuf:"bytes,7001,opt,name=previous_epoch_participation,json=previousEpochParticipation,proto3" json:"previous_epoch_participation,omitempty" ssz-max:"1099511627776"` + CurrentEpochParticipation []byte `protobuf:"bytes,7002,opt,name=current_epoch_participation,json=currentEpochParticipation,proto3" json:"current_epoch_participation,omitempty" ssz-max:"1099511627776"` + JustificationBits github_com_prysmaticlabs_go_bitfield.Bitvector4 `protobuf:"bytes,8001,opt,name=justification_bits,json=justificationBits,proto3" json:"justification_bits,omitempty" cast-type:"github.com/prysmaticlabs/go-bitfield.Bitvector4" ssz-size:"1"` + PreviousJustifiedCheckpoint *v1.Checkpoint `protobuf:"bytes,8002,opt,name=previous_justified_checkpoint,json=previousJustifiedCheckpoint,proto3" json:"previous_justified_checkpoint,omitempty"` + CurrentJustifiedCheckpoint *v1.Checkpoint `protobuf:"bytes,8003,opt,name=current_justified_checkpoint,json=currentJustifiedCheckpoint,proto3" json:"current_justified_checkpoint,omitempty"` + FinalizedCheckpoint *v1.Checkpoint `protobuf:"bytes,8004,opt,name=finalized_checkpoint,json=finalizedCheckpoint,proto3" json:"finalized_checkpoint,omitempty"` + InactivityScores []uint64 `protobuf:"varint,9001,rep,packed,name=inactivity_scores,json=inactivityScores,proto3" json:"inactivity_scores,omitempty" ssz-max:"1099511627776"` + CurrentSyncCommittee *SyncCommittee `protobuf:"bytes,9002,opt,name=current_sync_committee,json=currentSyncCommittee,proto3" json:"current_sync_committee,omitempty"` + NextSyncCommittee *SyncCommittee `protobuf:"bytes,9003,opt,name=next_sync_committee,json=nextSyncCommittee,proto3" json:"next_sync_committee,omitempty"` + LatestExecutionPayloadHeader *v11.ExecutionPayloadHeaderDeneb `protobuf:"bytes,10001,opt,name=latest_execution_payload_header,json=latestExecutionPayloadHeader,proto3" json:"latest_execution_payload_header,omitempty"` + NextWithdrawalIndex uint64 `protobuf:"varint,11001,opt,name=next_withdrawal_index,json=nextWithdrawalIndex,proto3" json:"next_withdrawal_index,omitempty"` + NextWithdrawalValidatorIndex github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex `protobuf:"varint,11002,opt,name=next_withdrawal_validator_index,json=nextWithdrawalValidatorIndex,proto3" json:"next_withdrawal_validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"` + HistoricalSummaries []*HistoricalSummary `protobuf:"bytes,11003,rep,name=historical_summaries,json=historicalSummaries,proto3" json:"historical_summaries,omitempty" ssz-max:"16777216"` +} + +func (x *BeaconStateDeneb) Reset() { + *x = BeaconStateDeneb{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BeaconStateDeneb) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BeaconStateDeneb) ProtoMessage() {} + +func (x *BeaconStateDeneb) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BeaconStateDeneb.ProtoReflect.Descriptor instead. +func (*BeaconStateDeneb) Descriptor() ([]byte, []int) { + return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{3} +} + +func (x *BeaconStateDeneb) GetGenesisTime() uint64 { + if x != nil { + return x.GenesisTime + } + return 0 +} + +func (x *BeaconStateDeneb) GetGenesisValidatorsRoot() []byte { + if x != nil { + return x.GenesisValidatorsRoot + } + return nil +} + +func (x *BeaconStateDeneb) GetSlot() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot { + if x != nil { + return x.Slot + } + return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot(0) +} + +func (x *BeaconStateDeneb) GetFork() *v1.Fork { + if x != nil { + return x.Fork + } + return nil +} + +func (x *BeaconStateDeneb) GetLatestBlockHeader() *v1.BeaconBlockHeader { + if x != nil { + return x.LatestBlockHeader + } + return nil +} + +func (x *BeaconStateDeneb) GetBlockRoots() [][]byte { + if x != nil { + return x.BlockRoots + } + return nil +} + +func (x *BeaconStateDeneb) GetStateRoots() [][]byte { + if x != nil { + return x.StateRoots + } + return nil +} + +func (x *BeaconStateDeneb) GetHistoricalRoots() [][]byte { + if x != nil { + return x.HistoricalRoots + } + return nil +} + +func (x *BeaconStateDeneb) GetEth1Data() *v1.Eth1Data { + if x != nil { + return x.Eth1Data + } + return nil +} + +func (x *BeaconStateDeneb) GetEth1DataVotes() []*v1.Eth1Data { + if x != nil { + return x.Eth1DataVotes + } + return nil +} + +func (x *BeaconStateDeneb) GetEth1DepositIndex() uint64 { + if x != nil { + return x.Eth1DepositIndex + } + return 0 +} + +func (x *BeaconStateDeneb) GetValidators() []*v1.Validator { + if x != nil { + return x.Validators + } + return nil +} + +func (x *BeaconStateDeneb) GetBalances() []uint64 { + if x != nil { + return x.Balances + } + return nil +} + +func (x *BeaconStateDeneb) GetRandaoMixes() [][]byte { + if x != nil { + return x.RandaoMixes + } + return nil +} + +func (x *BeaconStateDeneb) GetSlashings() []uint64 { + if x != nil { + return x.Slashings + } + return nil +} + +func (x *BeaconStateDeneb) GetPreviousEpochParticipation() []byte { + if x != nil { + return x.PreviousEpochParticipation + } + return nil +} + +func (x *BeaconStateDeneb) GetCurrentEpochParticipation() []byte { + if x != nil { + return x.CurrentEpochParticipation + } + return nil +} + +func (x *BeaconStateDeneb) GetJustificationBits() github_com_prysmaticlabs_go_bitfield.Bitvector4 { + if x != nil { + return x.JustificationBits + } + return github_com_prysmaticlabs_go_bitfield.Bitvector4(nil) +} + +func (x *BeaconStateDeneb) GetPreviousJustifiedCheckpoint() *v1.Checkpoint { + if x != nil { + return x.PreviousJustifiedCheckpoint + } + return nil +} + +func (x *BeaconStateDeneb) GetCurrentJustifiedCheckpoint() *v1.Checkpoint { + if x != nil { + return x.CurrentJustifiedCheckpoint + } + return nil +} + +func (x *BeaconStateDeneb) GetFinalizedCheckpoint() *v1.Checkpoint { + if x != nil { + return x.FinalizedCheckpoint + } + return nil +} + +func (x *BeaconStateDeneb) GetInactivityScores() []uint64 { + if x != nil { + return x.InactivityScores + } + return nil +} + +func (x *BeaconStateDeneb) GetCurrentSyncCommittee() *SyncCommittee { + if x != nil { + return x.CurrentSyncCommittee + } + return nil +} + +func (x *BeaconStateDeneb) GetNextSyncCommittee() *SyncCommittee { + if x != nil { + return x.NextSyncCommittee + } + return nil +} + +func (x *BeaconStateDeneb) GetLatestExecutionPayloadHeader() *v11.ExecutionPayloadHeaderDeneb { + if x != nil { + return x.LatestExecutionPayloadHeader + } + return nil +} + +func (x *BeaconStateDeneb) GetNextWithdrawalIndex() uint64 { + if x != nil { + return x.NextWithdrawalIndex + } + return 0 +} + +func (x *BeaconStateDeneb) GetNextWithdrawalValidatorIndex() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.NextWithdrawalValidatorIndex + } + return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *BeaconStateDeneb) GetHistoricalSummaries() []*HistoricalSummary { + if x != nil { + return x.HistoricalSummaries + } + return nil +} + type HistoricalSummary struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -771,7 +1034,7 @@ type HistoricalSummary struct { func (x *HistoricalSummary) Reset() { *x = HistoricalSummary{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[3] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -784,7 +1047,7 @@ func (x *HistoricalSummary) String() string { func (*HistoricalSummary) ProtoMessage() {} func (x *HistoricalSummary) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[3] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -797,7 +1060,7 @@ func (x *HistoricalSummary) ProtoReflect() protoreflect.Message { // Deprecated: Use HistoricalSummary.ProtoReflect.Descriptor instead. func (*HistoricalSummary) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{3} + return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{4} } func (x *HistoricalSummary) GetBlockSummaryRoot() []byte { @@ -825,7 +1088,7 @@ type BeaconStateRequestV2 struct { func (x *BeaconStateRequestV2) Reset() { *x = BeaconStateRequestV2{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[4] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -838,7 +1101,7 @@ func (x *BeaconStateRequestV2) String() string { func (*BeaconStateRequestV2) ProtoMessage() {} func (x *BeaconStateRequestV2) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[4] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -851,7 +1114,7 @@ func (x *BeaconStateRequestV2) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconStateRequestV2.ProtoReflect.Descriptor instead. func (*BeaconStateRequestV2) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{4} + return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{5} } func (x *BeaconStateRequestV2) GetStateId() []byte { @@ -875,7 +1138,7 @@ type BeaconStateResponseV2 struct { func (x *BeaconStateResponseV2) Reset() { *x = BeaconStateResponseV2{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[5] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -888,7 +1151,7 @@ func (x *BeaconStateResponseV2) String() string { func (*BeaconStateResponseV2) ProtoMessage() {} func (x *BeaconStateResponseV2) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[5] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -901,7 +1164,7 @@ func (x *BeaconStateResponseV2) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconStateResponseV2.ProtoReflect.Descriptor instead. func (*BeaconStateResponseV2) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{5} + return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{6} } func (x *BeaconStateResponseV2) GetVersion() Version { @@ -944,7 +1207,7 @@ type BeaconStateSSZResponseV2 struct { func (x *BeaconStateSSZResponseV2) Reset() { *x = BeaconStateSSZResponseV2{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[6] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -957,7 +1220,7 @@ func (x *BeaconStateSSZResponseV2) String() string { func (*BeaconStateSSZResponseV2) ProtoMessage() {} func (x *BeaconStateSSZResponseV2) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[6] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -970,7 +1233,7 @@ func (x *BeaconStateSSZResponseV2) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconStateSSZResponseV2.ProtoReflect.Descriptor instead. func (*BeaconStateSSZResponseV2) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{6} + return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{7} } func (x *BeaconStateSSZResponseV2) GetVersion() Version { @@ -998,13 +1261,14 @@ type BeaconStateContainer struct { // *BeaconStateContainer_AltairState // *BeaconStateContainer_BellatrixState // *BeaconStateContainer_CapellaState + // *BeaconStateContainer_DenebState State isBeaconStateContainer_State `protobuf_oneof:"state"` } func (x *BeaconStateContainer) Reset() { *x = BeaconStateContainer{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[7] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1017,7 +1281,7 @@ func (x *BeaconStateContainer) String() string { func (*BeaconStateContainer) ProtoMessage() {} func (x *BeaconStateContainer) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[7] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1030,7 +1294,7 @@ func (x *BeaconStateContainer) ProtoReflect() protoreflect.Message { // Deprecated: Use BeaconStateContainer.ProtoReflect.Descriptor instead. func (*BeaconStateContainer) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{7} + return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{8} } func (m *BeaconStateContainer) GetState() isBeaconStateContainer_State { @@ -1068,6 +1332,13 @@ func (x *BeaconStateContainer) GetCapellaState() *BeaconStateCapella { return nil } +func (x *BeaconStateContainer) GetDenebState() *BeaconStateDeneb { + if x, ok := x.GetState().(*BeaconStateContainer_DenebState); ok { + return x.DenebState + } + return nil +} + type isBeaconStateContainer_State interface { isBeaconStateContainer_State() } @@ -1088,6 +1359,10 @@ type BeaconStateContainer_CapellaState struct { CapellaState *BeaconStateCapella `protobuf:"bytes,4,opt,name=capella_state,json=capellaState,proto3,oneof"` } +type BeaconStateContainer_DenebState struct { + DenebState *BeaconStateDeneb `protobuf:"bytes,5,opt,name=deneb_state,json=denebState,proto3,oneof"` +} + func (*BeaconStateContainer_Phase0State) isBeaconStateContainer_State() {} func (*BeaconStateContainer_AltairState) isBeaconStateContainer_State() {} @@ -1096,6 +1371,8 @@ func (*BeaconStateContainer_BellatrixState) isBeaconStateContainer_State() {} func (*BeaconStateContainer_CapellaState) isBeaconStateContainer_State() {} +func (*BeaconStateContainer_DenebState) isBeaconStateContainer_State() {} + type ForkChoiceHeadsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1107,7 +1384,7 @@ type ForkChoiceHeadsResponse struct { func (x *ForkChoiceHeadsResponse) Reset() { *x = ForkChoiceHeadsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[8] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1120,7 +1397,7 @@ func (x *ForkChoiceHeadsResponse) String() string { func (*ForkChoiceHeadsResponse) ProtoMessage() {} func (x *ForkChoiceHeadsResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[8] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1133,7 +1410,7 @@ func (x *ForkChoiceHeadsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ForkChoiceHeadsResponse.ProtoReflect.Descriptor instead. func (*ForkChoiceHeadsResponse) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{8} + return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{9} } func (x *ForkChoiceHeadsResponse) GetData() []*ForkChoiceHead { @@ -1156,7 +1433,7 @@ type ForkChoiceHead struct { func (x *ForkChoiceHead) Reset() { *x = ForkChoiceHead{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[9] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1169,7 +1446,7 @@ func (x *ForkChoiceHead) String() string { func (*ForkChoiceHead) ProtoMessage() {} func (x *ForkChoiceHead) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[9] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1182,7 +1459,7 @@ func (x *ForkChoiceHead) ProtoReflect() protoreflect.Message { // Deprecated: Use ForkChoiceHead.ProtoReflect.Descriptor instead. func (*ForkChoiceHead) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{9} + return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{10} } func (x *ForkChoiceHead) GetRoot() []byte { @@ -1218,7 +1495,7 @@ type RandaoRequest struct { func (x *RandaoRequest) Reset() { *x = RandaoRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[10] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1231,7 +1508,7 @@ func (x *RandaoRequest) String() string { func (*RandaoRequest) ProtoMessage() {} func (x *RandaoRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[10] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1244,7 +1521,7 @@ func (x *RandaoRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RandaoRequest.ProtoReflect.Descriptor instead. func (*RandaoRequest) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{10} + return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{11} } func (x *RandaoRequest) GetStateId() []byte { @@ -1274,7 +1551,7 @@ type RandaoResponse struct { func (x *RandaoResponse) Reset() { *x = RandaoResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[11] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1287,7 +1564,7 @@ func (x *RandaoResponse) String() string { func (*RandaoResponse) ProtoMessage() {} func (x *RandaoResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[11] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1300,7 +1577,7 @@ func (x *RandaoResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RandaoResponse.ProtoReflect.Descriptor instead. func (*RandaoResponse) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{11} + return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{12} } func (x *RandaoResponse) GetData() *RandaoResponse_Randao { @@ -1335,7 +1612,7 @@ type RandaoResponse_Randao struct { func (x *RandaoResponse_Randao) Reset() { *x = RandaoResponse_Randao{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[12] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1348,7 +1625,7 @@ func (x *RandaoResponse_Randao) String() string { func (*RandaoResponse_Randao) ProtoMessage() {} func (x *RandaoResponse_Randao) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[12] + mi := &file_proto_eth_v2_beacon_state_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1361,7 +1638,7 @@ func (x *RandaoResponse_Randao) ProtoReflect() protoreflect.Message { // Deprecated: Use RandaoResponse_Randao.ProtoReflect.Descriptor instead. func (*RandaoResponse_Randao) Descriptor() ([]byte, []int) { - return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{11, 0} + return file_proto_eth_v2_beacon_state_proto_rawDescGZIP(), []int{12, 0} } func (x *RandaoResponse_Randao) GetRandao() []byte { @@ -1744,106 +2021,243 @@ var file_proto_eth_v2_beacon_state_proto_rawDesc = []byte{ 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, - 0x69, 0x65, 0x73, 0x22, 0x7f, 0x0a, 0x11, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, - 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x34, 0x0a, 0x12, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x34, - 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, - 0x33, 0x32, 0x52, 0x10, 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, - 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x31, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x32, 0x12, 0x19, 0x0a, 0x08, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x49, 0x64, 0x22, 0xd7, 0x01, 0x0a, 0x15, 0x42, 0x65, 0x61, 0x63, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, - 0x32, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, + 0x69, 0x65, 0x73, 0x22, 0xc3, 0x10, 0x0a, 0x10, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x12, 0x22, 0x0a, 0x0c, 0x67, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0b, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x17, + 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x15, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x5a, 0x0a, + 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0xeb, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, + 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, + 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x66, 0x6f, 0x72, + 0x6b, 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, + 0x04, 0x66, 0x6f, 0x72, 0x6b, 0x12, 0x53, 0x0a, 0x13, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0xd1, 0x0f, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x0b, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd2, 0x0f, 0x20, 0x03, 0x28, 0x0c, + 0x42, 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x0b, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd3, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x42, + 0x0b, 0x8a, 0xb5, 0x18, 0x07, 0x38, 0x31, 0x39, 0x32, 0x2c, 0x33, 0x32, 0x52, 0x0a, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x10, 0x68, 0x69, 0x73, 0x74, + 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0xd4, 0x0f, 0x20, + 0x03, 0x28, 0x0c, 0x42, 0x14, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x33, 0x32, 0x92, 0xb5, 0x18, + 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x0f, 0x68, 0x69, 0x73, 0x74, 0x6f, + 0x72, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x74, + 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0xb9, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x65, 0x74, 0x68, 0x31, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x4c, 0x0a, 0x0f, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x61, 0x74, 0x61, + 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0xba, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x42, 0x08, 0x92, 0xb5, 0x18, 0x04, 0x32, 0x30, + 0x34, 0x38, 0x52, 0x0d, 0x65, 0x74, 0x68, 0x31, 0x44, 0x61, 0x74, 0x61, 0x56, 0x6f, 0x74, 0x65, + 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x74, 0x68, 0x31, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xbb, 0x17, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, + 0x65, 0x74, 0x68, 0x31, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x4e, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0xa1, + 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, + 0x37, 0x37, 0x37, 0x36, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, + 0x12, 0x2e, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0xa2, 0x1f, 0x20, + 0x03, 0x28, 0x04, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, + 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, + 0x12, 0x30, 0x0a, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x5f, 0x6d, 0x69, 0x78, 0x65, 0x73, + 0x18, 0x89, 0x27, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x0c, 0x8a, 0xb5, 0x18, 0x08, 0x36, 0x35, 0x35, + 0x33, 0x36, 0x2c, 0x33, 0x32, 0x52, 0x0b, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x4d, 0x69, 0x78, + 0x65, 0x73, 0x12, 0x27, 0x0a, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x18, + 0xf1, 0x2e, 0x20, 0x03, 0x28, 0x04, 0x42, 0x08, 0x8a, 0xb5, 0x18, 0x04, 0x38, 0x31, 0x39, 0x32, + 0x52, 0x09, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x1c, 0x70, + 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xd9, 0x36, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, + 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x52, 0x0a, 0x1b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0xda, 0x36, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x11, 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, + 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x52, 0x19, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x68, 0x0a, 0x12, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x18, 0xc1, 0x3e, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x38, 0x82, 0xb5, 0x18, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x67, 0x6f, 0x2d, 0x62, 0x69, 0x74, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x42, 0x69, 0x74, + 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x34, 0x8a, 0xb5, 0x18, 0x01, 0x31, 0x52, 0x11, 0x6a, 0x75, + 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x74, 0x73, 0x12, + 0x60, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x6a, 0x75, 0x73, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x18, 0xc2, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1b, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x4a, 0x75, + 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x12, 0x5e, 0x0a, 0x1c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6a, 0x75, 0x73, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x18, 0xc3, 0x3e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4a, 0x75, + 0x73, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x12, 0x4f, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0xc4, 0x3e, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x13, 0x66, + 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x11, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, + 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0xa9, 0x46, 0x20, 0x03, 0x28, 0x04, 0x42, 0x11, + 0x92, 0xb5, 0x18, 0x0d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, + 0x36, 0x52, 0x10, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x63, 0x6f, + 0x72, 0x65, 0x73, 0x12, 0x55, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, + 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0xaa, 0x46, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, + 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x4f, 0x0a, 0x13, 0x6e, 0x65, + 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, + 0x65, 0x18, 0xab, 0x46, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, + 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x77, 0x0a, 0x1f, 0x6c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x91, + 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x1c, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xf9, 0x55, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x97, 0x01, 0x0a, 0x1f, 0x6e, 0x65, + 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xfa, 0x55, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, + 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1c, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x64, 0x0a, 0x14, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, + 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0xfb, 0x55, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, 0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, + 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, + 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x22, 0x7f, 0x0a, 0x11, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x34, + 0x0a, 0x12, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x34, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, + 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x10, 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x31, 0x0a, 0x14, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x56, 0x32, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x74, 0x61, 0x74, 0x65, 0x49, 0x64, 0x22, 0xd7, 0x01, + 0x0a, 0x15, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x32, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x65, 0x61, 0x63, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x31, 0x0a, 0x14, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4f, + 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x22, 0x62, 0x0a, 0x18, 0x42, 0x65, 0x61, 0x63, 0x6f, + 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x53, 0x5a, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x56, 0x32, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x89, 0x03, 0x0a, 0x14, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x0c, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x68, 0x61, 0x73, + 0x65, 0x30, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x61, 0x6c, 0x74, 0x61, 0x69, + 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x61, + 0x6c, 0x74, 0x61, 0x69, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x50, 0x0a, 0x0f, 0x62, 0x65, + 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x31, 0x0a, 0x14, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, - 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, - 0x74, 0x69, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, - 0x64, 0x22, 0x62, 0x0a, 0x18, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x53, 0x53, 0x5a, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x32, 0x12, 0x32, 0x0a, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, - 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xc3, 0x02, 0x0a, 0x14, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x41, - 0x0a, 0x0c, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x68, 0x61, 0x73, 0x65, 0x30, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x12, 0x50, 0x0a, 0x0f, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, - 0x78, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x65, 0x6c, 0x6c, 0x61, - 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, - 0x78, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x4a, 0x0a, 0x0d, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, - 0x61, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x65, 0x42, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x65, + 0x6c, 0x6c, 0x61, 0x74, 0x72, 0x69, 0x78, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x4a, 0x0a, 0x0d, + 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x43, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x63, 0x61, 0x70, 0x65, + 0x6c, 0x6c, 0x61, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x44, 0x0a, 0x0b, 0x64, 0x65, 0x6e, 0x65, + 0x62, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, - 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x61, 0x70, 0x65, 0x6c, - 0x6c, 0x61, 0x48, 0x00, 0x52, 0x0c, 0x63, 0x61, 0x70, 0x65, 0x6c, 0x6c, 0x61, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x4e, 0x0a, 0x17, 0x46, - 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x64, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, - 0x65, 0x48, 0x65, 0x61, 0x64, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xba, 0x01, 0x0a, 0x0e, - 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x64, 0x12, 0x1a, - 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, - 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, - 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x31, 0x0a, 0x14, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, - 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x22, 0x97, 0x01, 0x0a, 0x0d, 0x52, 0x61, 0x6e, - 0x64, 0x61, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x61, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x44, 0x65, 0x6e, 0x65, 0x62, + 0x48, 0x00, 0x52, 0x0a, 0x64, 0x65, 0x6e, 0x65, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x07, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x4e, 0x0a, 0x17, 0x46, 0x6f, 0x72, 0x6b, 0x43, + 0x68, 0x6f, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x32, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, + 0x64, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xba, 0x01, 0x0a, 0x0e, 0x46, 0x6f, 0x72, 0x6b, + 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x64, 0x12, 0x1a, 0x0a, 0x04, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x22, 0xc7, 0x01, 0x0a, 0x0e, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, - 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x31, 0x0a, 0x14, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, - 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, + 0x74, 0x12, 0x31, 0x0a, 0x14, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, + 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, - 0x73, 0x74, 0x69, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, - 0x65, 0x64, 0x1a, 0x28, 0x0a, 0x06, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x1e, 0x0a, 0x06, - 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x42, 0x83, 0x01, 0x0a, - 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, - 0x68, 0x2e, 0x76, 0x32, 0x42, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x74, 0x65, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, - 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, - 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x32, - 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, - 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x74, 0x69, 0x63, 0x22, 0x97, 0x01, 0x0a, 0x0d, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x74, 0x61, 0x74, 0x65, 0x49, + 0x64, 0x12, 0x61, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0xc7, + 0x01, 0x0a, 0x0e, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, + 0x32, 0x2e, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x31, 0x0a, + 0x14, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x1a, 0x28, + 0x0a, 0x06, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x1e, 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x64, + 0x61, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x06, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x42, 0x83, 0x01, 0x0a, 0x13, 0x6f, 0x72, 0x67, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, + 0x42, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1858,80 +2272,95 @@ func file_proto_eth_v2_beacon_state_proto_rawDescGZIP() []byte { return file_proto_eth_v2_beacon_state_proto_rawDescData } -var file_proto_eth_v2_beacon_state_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_proto_eth_v2_beacon_state_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_proto_eth_v2_beacon_state_proto_goTypes = []interface{}{ (*BeaconState)(nil), // 0: ethereum.eth.v2.BeaconState (*BeaconStateBellatrix)(nil), // 1: ethereum.eth.v2.BeaconStateBellatrix (*BeaconStateCapella)(nil), // 2: ethereum.eth.v2.BeaconStateCapella - (*HistoricalSummary)(nil), // 3: ethereum.eth.v2.HistoricalSummary - (*BeaconStateRequestV2)(nil), // 4: ethereum.eth.v2.BeaconStateRequestV2 - (*BeaconStateResponseV2)(nil), // 5: ethereum.eth.v2.BeaconStateResponseV2 - (*BeaconStateSSZResponseV2)(nil), // 6: ethereum.eth.v2.BeaconStateSSZResponseV2 - (*BeaconStateContainer)(nil), // 7: ethereum.eth.v2.BeaconStateContainer - (*ForkChoiceHeadsResponse)(nil), // 8: ethereum.eth.v2.ForkChoiceHeadsResponse - (*ForkChoiceHead)(nil), // 9: ethereum.eth.v2.ForkChoiceHead - (*RandaoRequest)(nil), // 10: ethereum.eth.v2.RandaoRequest - (*RandaoResponse)(nil), // 11: ethereum.eth.v2.RandaoResponse - (*RandaoResponse_Randao)(nil), // 12: ethereum.eth.v2.RandaoResponse.Randao - (*v1.Fork)(nil), // 13: ethereum.eth.v1.Fork - (*v1.BeaconBlockHeader)(nil), // 14: ethereum.eth.v1.BeaconBlockHeader - (*v1.Eth1Data)(nil), // 15: ethereum.eth.v1.Eth1Data - (*v1.Validator)(nil), // 16: ethereum.eth.v1.Validator - (*v1.Checkpoint)(nil), // 17: ethereum.eth.v1.Checkpoint - (*SyncCommittee)(nil), // 18: ethereum.eth.v2.SyncCommittee - (*v11.ExecutionPayloadHeader)(nil), // 19: ethereum.engine.v1.ExecutionPayloadHeader - (*v11.ExecutionPayloadHeaderCapella)(nil), // 20: ethereum.engine.v1.ExecutionPayloadHeaderCapella - (Version)(0), // 21: ethereum.eth.v2.Version - (*v1.BeaconState)(nil), // 22: ethereum.eth.v1.BeaconState + (*BeaconStateDeneb)(nil), // 3: ethereum.eth.v2.BeaconStateDeneb + (*HistoricalSummary)(nil), // 4: ethereum.eth.v2.HistoricalSummary + (*BeaconStateRequestV2)(nil), // 5: ethereum.eth.v2.BeaconStateRequestV2 + (*BeaconStateResponseV2)(nil), // 6: ethereum.eth.v2.BeaconStateResponseV2 + (*BeaconStateSSZResponseV2)(nil), // 7: ethereum.eth.v2.BeaconStateSSZResponseV2 + (*BeaconStateContainer)(nil), // 8: ethereum.eth.v2.BeaconStateContainer + (*ForkChoiceHeadsResponse)(nil), // 9: ethereum.eth.v2.ForkChoiceHeadsResponse + (*ForkChoiceHead)(nil), // 10: ethereum.eth.v2.ForkChoiceHead + (*RandaoRequest)(nil), // 11: ethereum.eth.v2.RandaoRequest + (*RandaoResponse)(nil), // 12: ethereum.eth.v2.RandaoResponse + (*RandaoResponse_Randao)(nil), // 13: ethereum.eth.v2.RandaoResponse.Randao + (*v1.Fork)(nil), // 14: ethereum.eth.v1.Fork + (*v1.BeaconBlockHeader)(nil), // 15: ethereum.eth.v1.BeaconBlockHeader + (*v1.Eth1Data)(nil), // 16: ethereum.eth.v1.Eth1Data + (*v1.Validator)(nil), // 17: ethereum.eth.v1.Validator + (*v1.Checkpoint)(nil), // 18: ethereum.eth.v1.Checkpoint + (*SyncCommittee)(nil), // 19: ethereum.eth.v2.SyncCommittee + (*v11.ExecutionPayloadHeader)(nil), // 20: ethereum.engine.v1.ExecutionPayloadHeader + (*v11.ExecutionPayloadHeaderCapella)(nil), // 21: ethereum.engine.v1.ExecutionPayloadHeaderCapella + (*v11.ExecutionPayloadHeaderDeneb)(nil), // 22: ethereum.engine.v1.ExecutionPayloadHeaderDeneb + (Version)(0), // 23: ethereum.eth.v2.Version + (*v1.BeaconState)(nil), // 24: ethereum.eth.v1.BeaconState } var file_proto_eth_v2_beacon_state_proto_depIdxs = []int32{ - 13, // 0: ethereum.eth.v2.BeaconState.fork:type_name -> ethereum.eth.v1.Fork - 14, // 1: ethereum.eth.v2.BeaconState.latest_block_header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 15, // 2: ethereum.eth.v2.BeaconState.eth1_data:type_name -> ethereum.eth.v1.Eth1Data - 15, // 3: ethereum.eth.v2.BeaconState.eth1_data_votes:type_name -> ethereum.eth.v1.Eth1Data - 16, // 4: ethereum.eth.v2.BeaconState.validators:type_name -> ethereum.eth.v1.Validator - 17, // 5: ethereum.eth.v2.BeaconState.previous_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint - 17, // 6: ethereum.eth.v2.BeaconState.current_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint - 17, // 7: ethereum.eth.v2.BeaconState.finalized_checkpoint:type_name -> ethereum.eth.v1.Checkpoint - 18, // 8: ethereum.eth.v2.BeaconState.current_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee - 18, // 9: ethereum.eth.v2.BeaconState.next_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee - 13, // 10: ethereum.eth.v2.BeaconStateBellatrix.fork:type_name -> ethereum.eth.v1.Fork - 14, // 11: ethereum.eth.v2.BeaconStateBellatrix.latest_block_header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 15, // 12: ethereum.eth.v2.BeaconStateBellatrix.eth1_data:type_name -> ethereum.eth.v1.Eth1Data - 15, // 13: ethereum.eth.v2.BeaconStateBellatrix.eth1_data_votes:type_name -> ethereum.eth.v1.Eth1Data - 16, // 14: ethereum.eth.v2.BeaconStateBellatrix.validators:type_name -> ethereum.eth.v1.Validator - 17, // 15: ethereum.eth.v2.BeaconStateBellatrix.previous_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint - 17, // 16: ethereum.eth.v2.BeaconStateBellatrix.current_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint - 17, // 17: ethereum.eth.v2.BeaconStateBellatrix.finalized_checkpoint:type_name -> ethereum.eth.v1.Checkpoint - 18, // 18: ethereum.eth.v2.BeaconStateBellatrix.current_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee - 18, // 19: ethereum.eth.v2.BeaconStateBellatrix.next_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee - 19, // 20: ethereum.eth.v2.BeaconStateBellatrix.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader - 13, // 21: ethereum.eth.v2.BeaconStateCapella.fork:type_name -> ethereum.eth.v1.Fork - 14, // 22: ethereum.eth.v2.BeaconStateCapella.latest_block_header:type_name -> ethereum.eth.v1.BeaconBlockHeader - 15, // 23: ethereum.eth.v2.BeaconStateCapella.eth1_data:type_name -> ethereum.eth.v1.Eth1Data - 15, // 24: ethereum.eth.v2.BeaconStateCapella.eth1_data_votes:type_name -> ethereum.eth.v1.Eth1Data - 16, // 25: ethereum.eth.v2.BeaconStateCapella.validators:type_name -> ethereum.eth.v1.Validator - 17, // 26: ethereum.eth.v2.BeaconStateCapella.previous_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint - 17, // 27: ethereum.eth.v2.BeaconStateCapella.current_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint - 17, // 28: ethereum.eth.v2.BeaconStateCapella.finalized_checkpoint:type_name -> ethereum.eth.v1.Checkpoint - 18, // 29: ethereum.eth.v2.BeaconStateCapella.current_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee - 18, // 30: ethereum.eth.v2.BeaconStateCapella.next_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee - 20, // 31: ethereum.eth.v2.BeaconStateCapella.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella - 3, // 32: ethereum.eth.v2.BeaconStateCapella.historical_summaries:type_name -> ethereum.eth.v2.HistoricalSummary - 21, // 33: ethereum.eth.v2.BeaconStateResponseV2.version:type_name -> ethereum.eth.v2.Version - 7, // 34: ethereum.eth.v2.BeaconStateResponseV2.data:type_name -> ethereum.eth.v2.BeaconStateContainer - 21, // 35: ethereum.eth.v2.BeaconStateSSZResponseV2.version:type_name -> ethereum.eth.v2.Version - 22, // 36: ethereum.eth.v2.BeaconStateContainer.phase0_state:type_name -> ethereum.eth.v1.BeaconState - 0, // 37: ethereum.eth.v2.BeaconStateContainer.altair_state:type_name -> ethereum.eth.v2.BeaconState - 1, // 38: ethereum.eth.v2.BeaconStateContainer.bellatrix_state:type_name -> ethereum.eth.v2.BeaconStateBellatrix - 2, // 39: ethereum.eth.v2.BeaconStateContainer.capella_state:type_name -> ethereum.eth.v2.BeaconStateCapella - 9, // 40: ethereum.eth.v2.ForkChoiceHeadsResponse.data:type_name -> ethereum.eth.v2.ForkChoiceHead - 12, // 41: ethereum.eth.v2.RandaoResponse.data:type_name -> ethereum.eth.v2.RandaoResponse.Randao - 42, // [42:42] is the sub-list for method output_type - 42, // [42:42] is the sub-list for method input_type - 42, // [42:42] is the sub-list for extension type_name - 42, // [42:42] is the sub-list for extension extendee - 0, // [0:42] is the sub-list for field type_name + 14, // 0: ethereum.eth.v2.BeaconState.fork:type_name -> ethereum.eth.v1.Fork + 15, // 1: ethereum.eth.v2.BeaconState.latest_block_header:type_name -> ethereum.eth.v1.BeaconBlockHeader + 16, // 2: ethereum.eth.v2.BeaconState.eth1_data:type_name -> ethereum.eth.v1.Eth1Data + 16, // 3: ethereum.eth.v2.BeaconState.eth1_data_votes:type_name -> ethereum.eth.v1.Eth1Data + 17, // 4: ethereum.eth.v2.BeaconState.validators:type_name -> ethereum.eth.v1.Validator + 18, // 5: ethereum.eth.v2.BeaconState.previous_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint + 18, // 6: ethereum.eth.v2.BeaconState.current_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint + 18, // 7: ethereum.eth.v2.BeaconState.finalized_checkpoint:type_name -> ethereum.eth.v1.Checkpoint + 19, // 8: ethereum.eth.v2.BeaconState.current_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 19, // 9: ethereum.eth.v2.BeaconState.next_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 14, // 10: ethereum.eth.v2.BeaconStateBellatrix.fork:type_name -> ethereum.eth.v1.Fork + 15, // 11: ethereum.eth.v2.BeaconStateBellatrix.latest_block_header:type_name -> ethereum.eth.v1.BeaconBlockHeader + 16, // 12: ethereum.eth.v2.BeaconStateBellatrix.eth1_data:type_name -> ethereum.eth.v1.Eth1Data + 16, // 13: ethereum.eth.v2.BeaconStateBellatrix.eth1_data_votes:type_name -> ethereum.eth.v1.Eth1Data + 17, // 14: ethereum.eth.v2.BeaconStateBellatrix.validators:type_name -> ethereum.eth.v1.Validator + 18, // 15: ethereum.eth.v2.BeaconStateBellatrix.previous_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint + 18, // 16: ethereum.eth.v2.BeaconStateBellatrix.current_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint + 18, // 17: ethereum.eth.v2.BeaconStateBellatrix.finalized_checkpoint:type_name -> ethereum.eth.v1.Checkpoint + 19, // 18: ethereum.eth.v2.BeaconStateBellatrix.current_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 19, // 19: ethereum.eth.v2.BeaconStateBellatrix.next_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 20, // 20: ethereum.eth.v2.BeaconStateBellatrix.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeader + 14, // 21: ethereum.eth.v2.BeaconStateCapella.fork:type_name -> ethereum.eth.v1.Fork + 15, // 22: ethereum.eth.v2.BeaconStateCapella.latest_block_header:type_name -> ethereum.eth.v1.BeaconBlockHeader + 16, // 23: ethereum.eth.v2.BeaconStateCapella.eth1_data:type_name -> ethereum.eth.v1.Eth1Data + 16, // 24: ethereum.eth.v2.BeaconStateCapella.eth1_data_votes:type_name -> ethereum.eth.v1.Eth1Data + 17, // 25: ethereum.eth.v2.BeaconStateCapella.validators:type_name -> ethereum.eth.v1.Validator + 18, // 26: ethereum.eth.v2.BeaconStateCapella.previous_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint + 18, // 27: ethereum.eth.v2.BeaconStateCapella.current_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint + 18, // 28: ethereum.eth.v2.BeaconStateCapella.finalized_checkpoint:type_name -> ethereum.eth.v1.Checkpoint + 19, // 29: ethereum.eth.v2.BeaconStateCapella.current_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 19, // 30: ethereum.eth.v2.BeaconStateCapella.next_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 21, // 31: ethereum.eth.v2.BeaconStateCapella.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderCapella + 4, // 32: ethereum.eth.v2.BeaconStateCapella.historical_summaries:type_name -> ethereum.eth.v2.HistoricalSummary + 14, // 33: ethereum.eth.v2.BeaconStateDeneb.fork:type_name -> ethereum.eth.v1.Fork + 15, // 34: ethereum.eth.v2.BeaconStateDeneb.latest_block_header:type_name -> ethereum.eth.v1.BeaconBlockHeader + 16, // 35: ethereum.eth.v2.BeaconStateDeneb.eth1_data:type_name -> ethereum.eth.v1.Eth1Data + 16, // 36: ethereum.eth.v2.BeaconStateDeneb.eth1_data_votes:type_name -> ethereum.eth.v1.Eth1Data + 17, // 37: ethereum.eth.v2.BeaconStateDeneb.validators:type_name -> ethereum.eth.v1.Validator + 18, // 38: ethereum.eth.v2.BeaconStateDeneb.previous_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint + 18, // 39: ethereum.eth.v2.BeaconStateDeneb.current_justified_checkpoint:type_name -> ethereum.eth.v1.Checkpoint + 18, // 40: ethereum.eth.v2.BeaconStateDeneb.finalized_checkpoint:type_name -> ethereum.eth.v1.Checkpoint + 19, // 41: ethereum.eth.v2.BeaconStateDeneb.current_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 19, // 42: ethereum.eth.v2.BeaconStateDeneb.next_sync_committee:type_name -> ethereum.eth.v2.SyncCommittee + 22, // 43: ethereum.eth.v2.BeaconStateDeneb.latest_execution_payload_header:type_name -> ethereum.engine.v1.ExecutionPayloadHeaderDeneb + 4, // 44: ethereum.eth.v2.BeaconStateDeneb.historical_summaries:type_name -> ethereum.eth.v2.HistoricalSummary + 23, // 45: ethereum.eth.v2.BeaconStateResponseV2.version:type_name -> ethereum.eth.v2.Version + 8, // 46: ethereum.eth.v2.BeaconStateResponseV2.data:type_name -> ethereum.eth.v2.BeaconStateContainer + 23, // 47: ethereum.eth.v2.BeaconStateSSZResponseV2.version:type_name -> ethereum.eth.v2.Version + 24, // 48: ethereum.eth.v2.BeaconStateContainer.phase0_state:type_name -> ethereum.eth.v1.BeaconState + 0, // 49: ethereum.eth.v2.BeaconStateContainer.altair_state:type_name -> ethereum.eth.v2.BeaconState + 1, // 50: ethereum.eth.v2.BeaconStateContainer.bellatrix_state:type_name -> ethereum.eth.v2.BeaconStateBellatrix + 2, // 51: ethereum.eth.v2.BeaconStateContainer.capella_state:type_name -> ethereum.eth.v2.BeaconStateCapella + 3, // 52: ethereum.eth.v2.BeaconStateContainer.deneb_state:type_name -> ethereum.eth.v2.BeaconStateDeneb + 10, // 53: ethereum.eth.v2.ForkChoiceHeadsResponse.data:type_name -> ethereum.eth.v2.ForkChoiceHead + 13, // 54: ethereum.eth.v2.RandaoResponse.data:type_name -> ethereum.eth.v2.RandaoResponse.Randao + 55, // [55:55] is the sub-list for method output_type + 55, // [55:55] is the sub-list for method input_type + 55, // [55:55] is the sub-list for extension type_name + 55, // [55:55] is the sub-list for extension extendee + 0, // [0:55] is the sub-list for field type_name } func init() { file_proto_eth_v2_beacon_state_proto_init() } @@ -1979,7 +2408,7 @@ func file_proto_eth_v2_beacon_state_proto_init() { } } file_proto_eth_v2_beacon_state_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistoricalSummary); i { + switch v := v.(*BeaconStateDeneb); i { case 0: return &v.state case 1: @@ -1991,7 +2420,7 @@ func file_proto_eth_v2_beacon_state_proto_init() { } } file_proto_eth_v2_beacon_state_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconStateRequestV2); i { + switch v := v.(*HistoricalSummary); i { case 0: return &v.state case 1: @@ -2003,7 +2432,7 @@ func file_proto_eth_v2_beacon_state_proto_init() { } } file_proto_eth_v2_beacon_state_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconStateResponseV2); i { + switch v := v.(*BeaconStateRequestV2); i { case 0: return &v.state case 1: @@ -2015,7 +2444,7 @@ func file_proto_eth_v2_beacon_state_proto_init() { } } file_proto_eth_v2_beacon_state_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconStateSSZResponseV2); i { + switch v := v.(*BeaconStateResponseV2); i { case 0: return &v.state case 1: @@ -2027,7 +2456,7 @@ func file_proto_eth_v2_beacon_state_proto_init() { } } file_proto_eth_v2_beacon_state_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BeaconStateContainer); i { + switch v := v.(*BeaconStateSSZResponseV2); i { case 0: return &v.state case 1: @@ -2039,7 +2468,7 @@ func file_proto_eth_v2_beacon_state_proto_init() { } } file_proto_eth_v2_beacon_state_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForkChoiceHeadsResponse); i { + switch v := v.(*BeaconStateContainer); i { case 0: return &v.state case 1: @@ -2051,7 +2480,7 @@ func file_proto_eth_v2_beacon_state_proto_init() { } } file_proto_eth_v2_beacon_state_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForkChoiceHead); i { + switch v := v.(*ForkChoiceHeadsResponse); i { case 0: return &v.state case 1: @@ -2063,7 +2492,7 @@ func file_proto_eth_v2_beacon_state_proto_init() { } } file_proto_eth_v2_beacon_state_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RandaoRequest); i { + switch v := v.(*ForkChoiceHead); i { case 0: return &v.state case 1: @@ -2075,7 +2504,7 @@ func file_proto_eth_v2_beacon_state_proto_init() { } } file_proto_eth_v2_beacon_state_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RandaoResponse); i { + switch v := v.(*RandaoRequest); i { case 0: return &v.state case 1: @@ -2087,6 +2516,18 @@ func file_proto_eth_v2_beacon_state_proto_init() { } } file_proto_eth_v2_beacon_state_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RandaoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_v2_beacon_state_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RandaoResponse_Randao); i { case 0: return &v.state @@ -2099,20 +2540,21 @@ func file_proto_eth_v2_beacon_state_proto_init() { } } } - file_proto_eth_v2_beacon_state_proto_msgTypes[7].OneofWrappers = []interface{}{ + file_proto_eth_v2_beacon_state_proto_msgTypes[8].OneofWrappers = []interface{}{ (*BeaconStateContainer_Phase0State)(nil), (*BeaconStateContainer_AltairState)(nil), (*BeaconStateContainer_BellatrixState)(nil), (*BeaconStateContainer_CapellaState)(nil), + (*BeaconStateContainer_DenebState)(nil), } - file_proto_eth_v2_beacon_state_proto_msgTypes[10].OneofWrappers = []interface{}{} + file_proto_eth_v2_beacon_state_proto_msgTypes[11].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_eth_v2_beacon_state_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 14, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/eth/v2/beacon_state.proto b/proto/eth/v2/beacon_state.proto index 108a52e7a0dc..e554721c421d 100644 --- a/proto/eth/v2/beacon_state.proto +++ b/proto/eth/v2/beacon_state.proto @@ -178,6 +178,50 @@ message BeaconStateCapella { 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"]; @@ -207,6 +251,7 @@ message BeaconStateContainer { BeaconState altair_state = 2; BeaconStateBellatrix bellatrix_state = 3; BeaconStateCapella capella_state = 4; + BeaconStateDeneb deneb_state = 5; } } diff --git a/proto/eth/v2/version.pb.go b/proto/eth/v2/version.pb.go index f23f15cdace2..833fe0e672eb 100755 --- a/proto/eth/v2/version.pb.go +++ b/proto/eth/v2/version.pb.go @@ -28,6 +28,7 @@ const ( Version_ALTAIR Version = 1 Version_BELLATRIX Version = 2 Version_CAPELLA Version = 3 + Version_DENEB Version = 4 ) // Enum value maps for Version. @@ -37,12 +38,14 @@ var ( 1: "ALTAIR", 2: "BELLATRIX", 3: "CAPELLA", + 4: "DENEB", } Version_value = map[string]int32{ "PHASE0": 0, "ALTAIR": 1, "BELLATRIX": 2, "CAPELLA": 3, + "DENEB": 4, } ) @@ -78,20 +81,20 @@ var File_proto_eth_v2_version_proto protoreflect.FileDescriptor var file_proto_eth_v2_version_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x65, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2a, 0x3d, 0x0a, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2a, 0x48, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x48, 0x41, 0x53, 0x45, 0x30, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x4c, 0x54, 0x41, 0x49, 0x52, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x45, 0x4c, 0x4c, 0x41, 0x54, 0x52, 0x49, 0x58, 0x10, 0x02, 0x12, - 0x0b, 0x0a, 0x07, 0x43, 0x41, 0x50, 0x45, 0x4c, 0x4c, 0x41, 0x10, 0x03, 0x42, 0x7d, 0x0a, 0x13, - 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, - 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, - 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x0b, 0x0a, 0x07, 0x43, 0x41, 0x50, 0x45, 0x4c, 0x4c, 0x41, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, + 0x44, 0x45, 0x4e, 0x45, 0x42, 0x10, 0x04, 0x42, 0x7d, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x0c, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x34, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, + 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, + 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, + 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/eth/v2/version.proto b/proto/eth/v2/version.proto index 3db94b07a825..05a610c311e5 100644 --- a/proto/eth/v2/version.proto +++ b/proto/eth/v2/version.proto @@ -28,4 +28,5 @@ enum Version { ALTAIR = 1; BELLATRIX = 2; CAPELLA = 3; + DENEB = 4; } diff --git a/proto/migration/v1alpha1_to_v2.go b/proto/migration/v1alpha1_to_v2.go index 7690d145ac9a..3c35d7a3237d 100644 --- a/proto/migration/v1alpha1_to_v2.go +++ b/proto/migration/v1alpha1_to_v2.go @@ -930,6 +930,173 @@ func BeaconStateCapellaToProto(st state.BeaconState) (*ethpbv2.BeaconStateCapell return result, nil } +// BeaconStateDenebToProto converts a state.BeaconState object to its protobuf equivalent. +func BeaconStateDenebToProto(st state.BeaconState) (*ethpbv2.BeaconStateDeneb, error) { + sourceFork := st.Fork() + sourceLatestBlockHeader := st.LatestBlockHeader() + sourceEth1Data := st.Eth1Data() + sourceEth1DataVotes := st.Eth1DataVotes() + sourceValidators := st.Validators() + sourceJustificationBits := st.JustificationBits() + sourcePrevJustifiedCheckpoint := st.PreviousJustifiedCheckpoint() + sourceCurrJustifiedCheckpoint := st.CurrentJustifiedCheckpoint() + sourceFinalizedCheckpoint := st.FinalizedCheckpoint() + + resultEth1DataVotes := make([]*ethpbv1.Eth1Data, len(sourceEth1DataVotes)) + for i, vote := range sourceEth1DataVotes { + resultEth1DataVotes[i] = ðpbv1.Eth1Data{ + DepositRoot: bytesutil.SafeCopyBytes(vote.DepositRoot), + DepositCount: vote.DepositCount, + BlockHash: bytesutil.SafeCopyBytes(vote.BlockHash), + } + } + resultValidators := make([]*ethpbv1.Validator, len(sourceValidators)) + for i, validator := range sourceValidators { + resultValidators[i] = ðpbv1.Validator{ + Pubkey: bytesutil.SafeCopyBytes(validator.PublicKey), + WithdrawalCredentials: bytesutil.SafeCopyBytes(validator.WithdrawalCredentials), + EffectiveBalance: validator.EffectiveBalance, + Slashed: validator.Slashed, + ActivationEligibilityEpoch: validator.ActivationEligibilityEpoch, + ActivationEpoch: validator.ActivationEpoch, + ExitEpoch: validator.ExitEpoch, + WithdrawableEpoch: validator.WithdrawableEpoch, + } + } + + sourcePrevEpochParticipation, err := st.PreviousEpochParticipation() + if err != nil { + return nil, errors.Wrap(err, "could not get previous epoch participation") + } + sourceCurrEpochParticipation, err := st.CurrentEpochParticipation() + if err != nil { + return nil, errors.Wrap(err, "could not get current epoch participation") + } + sourceInactivityScores, err := st.InactivityScores() + if err != nil { + return nil, errors.Wrap(err, "could not get inactivity scores") + } + sourceCurrSyncCommittee, err := st.CurrentSyncCommittee() + if err != nil { + return nil, errors.Wrap(err, "could not get current sync committee") + } + sourceNextSyncCommittee, err := st.NextSyncCommittee() + if err != nil { + return nil, errors.Wrap(err, "could not get next sync committee") + } + executionPayloadHeaderInterface, err := st.LatestExecutionPayloadHeader() + if err != nil { + return nil, errors.Wrap(err, "could not get latest execution payload header") + } + sourceLatestExecutionPayloadHeader, ok := executionPayloadHeaderInterface.Proto().(*enginev1.ExecutionPayloadHeaderDeneb) + if !ok { + return nil, errors.New("execution payload header has incorrect type") + } + sourceNextWithdrawalIndex, err := st.NextWithdrawalIndex() + if err != nil { + return nil, errors.Wrap(err, "could not get next withdrawal index") + } + sourceNextWithdrawalValIndex, err := st.NextWithdrawalValidatorIndex() + if err != nil { + return nil, errors.Wrap(err, "could not get next withdrawal validator index") + } + summaries, err := st.HistoricalSummaries() + if err != nil { + return nil, errors.Wrap(err, "could not get historical summaries") + } + sourceHistoricalSummaries := make([]*ethpbv2.HistoricalSummary, len(summaries)) + for i, summary := range summaries { + sourceHistoricalSummaries[i] = ðpbv2.HistoricalSummary{ + BlockSummaryRoot: summary.BlockSummaryRoot, + StateSummaryRoot: summary.StateSummaryRoot, + } + } + + hr, err := st.HistoricalRoots() + if err != nil { + return nil, errors.Wrap(err, "could not get historical roots") + } + + result := ðpbv2.BeaconStateDeneb{ + GenesisTime: st.GenesisTime(), + GenesisValidatorsRoot: bytesutil.SafeCopyBytes(st.GenesisValidatorsRoot()), + Slot: st.Slot(), + Fork: ðpbv1.Fork{ + PreviousVersion: bytesutil.SafeCopyBytes(sourceFork.PreviousVersion), + CurrentVersion: bytesutil.SafeCopyBytes(sourceFork.CurrentVersion), + Epoch: sourceFork.Epoch, + }, + LatestBlockHeader: ðpbv1.BeaconBlockHeader{ + Slot: sourceLatestBlockHeader.Slot, + ProposerIndex: sourceLatestBlockHeader.ProposerIndex, + ParentRoot: bytesutil.SafeCopyBytes(sourceLatestBlockHeader.ParentRoot), + StateRoot: bytesutil.SafeCopyBytes(sourceLatestBlockHeader.StateRoot), + BodyRoot: bytesutil.SafeCopyBytes(sourceLatestBlockHeader.BodyRoot), + }, + BlockRoots: bytesutil.SafeCopy2dBytes(st.BlockRoots()), + StateRoots: bytesutil.SafeCopy2dBytes(st.StateRoots()), + HistoricalRoots: bytesutil.SafeCopy2dBytes(hr), + Eth1Data: ðpbv1.Eth1Data{ + DepositRoot: bytesutil.SafeCopyBytes(sourceEth1Data.DepositRoot), + DepositCount: sourceEth1Data.DepositCount, + BlockHash: bytesutil.SafeCopyBytes(sourceEth1Data.BlockHash), + }, + Eth1DataVotes: resultEth1DataVotes, + Eth1DepositIndex: st.Eth1DepositIndex(), + Validators: resultValidators, + Balances: st.Balances(), + RandaoMixes: bytesutil.SafeCopy2dBytes(st.RandaoMixes()), + Slashings: st.Slashings(), + PreviousEpochParticipation: bytesutil.SafeCopyBytes(sourcePrevEpochParticipation), + CurrentEpochParticipation: bytesutil.SafeCopyBytes(sourceCurrEpochParticipation), + JustificationBits: bytesutil.SafeCopyBytes(sourceJustificationBits), + PreviousJustifiedCheckpoint: ðpbv1.Checkpoint{ + Epoch: sourcePrevJustifiedCheckpoint.Epoch, + Root: bytesutil.SafeCopyBytes(sourcePrevJustifiedCheckpoint.Root), + }, + CurrentJustifiedCheckpoint: ðpbv1.Checkpoint{ + Epoch: sourceCurrJustifiedCheckpoint.Epoch, + Root: bytesutil.SafeCopyBytes(sourceCurrJustifiedCheckpoint.Root), + }, + FinalizedCheckpoint: ðpbv1.Checkpoint{ + Epoch: sourceFinalizedCheckpoint.Epoch, + Root: bytesutil.SafeCopyBytes(sourceFinalizedCheckpoint.Root), + }, + InactivityScores: sourceInactivityScores, + CurrentSyncCommittee: ðpbv2.SyncCommittee{ + Pubkeys: bytesutil.SafeCopy2dBytes(sourceCurrSyncCommittee.Pubkeys), + AggregatePubkey: bytesutil.SafeCopyBytes(sourceCurrSyncCommittee.AggregatePubkey), + }, + NextSyncCommittee: ðpbv2.SyncCommittee{ + Pubkeys: bytesutil.SafeCopy2dBytes(sourceNextSyncCommittee.Pubkeys), + AggregatePubkey: bytesutil.SafeCopyBytes(sourceNextSyncCommittee.AggregatePubkey), + }, + LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderDeneb{ + ParentHash: bytesutil.SafeCopyBytes(sourceLatestExecutionPayloadHeader.ParentHash), + FeeRecipient: bytesutil.SafeCopyBytes(sourceLatestExecutionPayloadHeader.FeeRecipient), + StateRoot: bytesutil.SafeCopyBytes(sourceLatestExecutionPayloadHeader.StateRoot), + ReceiptsRoot: bytesutil.SafeCopyBytes(sourceLatestExecutionPayloadHeader.ReceiptsRoot), + LogsBloom: bytesutil.SafeCopyBytes(sourceLatestExecutionPayloadHeader.LogsBloom), + PrevRandao: bytesutil.SafeCopyBytes(sourceLatestExecutionPayloadHeader.PrevRandao), + BlockNumber: sourceLatestExecutionPayloadHeader.BlockNumber, + GasLimit: sourceLatestExecutionPayloadHeader.GasLimit, + GasUsed: sourceLatestExecutionPayloadHeader.GasUsed, + Timestamp: sourceLatestExecutionPayloadHeader.Timestamp, + ExtraData: bytesutil.SafeCopyBytes(sourceLatestExecutionPayloadHeader.ExtraData), + BaseFeePerGas: bytesutil.SafeCopyBytes(sourceLatestExecutionPayloadHeader.BaseFeePerGas), + ExcessDataGas: bytesutil.SafeCopyBytes(sourceLatestExecutionPayloadHeader.ExcessDataGas), + BlockHash: bytesutil.SafeCopyBytes(sourceLatestExecutionPayloadHeader.BlockHash), + TransactionsRoot: bytesutil.SafeCopyBytes(sourceLatestExecutionPayloadHeader.TransactionsRoot), + WithdrawalsRoot: bytesutil.SafeCopyBytes(sourceLatestExecutionPayloadHeader.WithdrawalsRoot), + }, + NextWithdrawalIndex: sourceNextWithdrawalIndex, + NextWithdrawalValidatorIndex: sourceNextWithdrawalValIndex, + HistoricalSummaries: sourceHistoricalSummaries, + } + + return result, nil +} + // V1Alpha1SignedContributionAndProofToV2 converts a v1alpha1 SignedContributionAndProof object to its v2 equivalent. func V1Alpha1SignedContributionAndProofToV2(alphaContribution *ethpbalpha.SignedContributionAndProof) *ethpbv2.SignedContributionAndProof { result := ðpbv2.SignedContributionAndProof{ diff --git a/proto/migration/v1alpha1_to_v2_test.go b/proto/migration/v1alpha1_to_v2_test.go index 7969034c23d2..466023b5e232 100644 --- a/proto/migration/v1alpha1_to_v2_test.go +++ b/proto/migration/v1alpha1_to_v2_test.go @@ -801,6 +801,204 @@ func TestBeaconStateCapellaToProto(t *testing.T) { assert.DeepEqual(t, bytesutil.PadTo([]byte("statesummaryroot2"), 32), result.HistoricalSummaries[1].StateSummaryRoot) } +func TestBeaconStateDenebToProto(t *testing.T) { + source, err := util.NewBeaconStateDeneb(util.FillRootsNaturalOptDeneb, func(state *ethpbalpha.BeaconStateDeneb) error { + state.GenesisTime = 1 + state.GenesisValidatorsRoot = bytesutil.PadTo([]byte("genesisvalidatorsroot"), 32) + state.Slot = 2 + state.Fork = ðpbalpha.Fork{ + PreviousVersion: bytesutil.PadTo([]byte("123"), 4), + CurrentVersion: bytesutil.PadTo([]byte("456"), 4), + Epoch: 3, + } + state.LatestBlockHeader = ðpbalpha.BeaconBlockHeader{ + Slot: 4, + ProposerIndex: 5, + ParentRoot: bytesutil.PadTo([]byte("lbhparentroot"), 32), + StateRoot: bytesutil.PadTo([]byte("lbhstateroot"), 32), + BodyRoot: bytesutil.PadTo([]byte("lbhbodyroot"), 32), + } + state.BlockRoots = [][]byte{bytesutil.PadTo([]byte("blockroots"), 32)} + state.StateRoots = [][]byte{bytesutil.PadTo([]byte("stateroots"), 32)} + state.HistoricalRoots = [][]byte{bytesutil.PadTo([]byte("historicalroots"), 32)} + state.Eth1Data = ðpbalpha.Eth1Data{ + DepositRoot: bytesutil.PadTo([]byte("e1ddepositroot"), 32), + DepositCount: 6, + BlockHash: bytesutil.PadTo([]byte("e1dblockhash"), 32), + } + state.Eth1DataVotes = []*ethpbalpha.Eth1Data{{ + DepositRoot: bytesutil.PadTo([]byte("e1dvdepositroot"), 32), + DepositCount: 7, + BlockHash: bytesutil.PadTo([]byte("e1dvblockhash"), 32), + }} + state.Eth1DepositIndex = 8 + state.Validators = []*ethpbalpha.Validator{{ + PublicKey: bytesutil.PadTo([]byte("publickey"), 48), + WithdrawalCredentials: bytesutil.PadTo([]byte("withdrawalcredentials"), 32), + EffectiveBalance: 9, + Slashed: true, + ActivationEligibilityEpoch: 10, + ActivationEpoch: 11, + ExitEpoch: 12, + WithdrawableEpoch: 13, + }} + state.Balances = []uint64{14} + state.RandaoMixes = [][]byte{bytesutil.PadTo([]byte("randaomixes"), 32)} + state.Slashings = []uint64{15} + state.JustificationBits = bitfield.Bitvector4{1} + state.PreviousJustifiedCheckpoint = ðpbalpha.Checkpoint{ + Epoch: 30, + Root: bytesutil.PadTo([]byte("pjcroot"), 32), + } + state.CurrentJustifiedCheckpoint = ðpbalpha.Checkpoint{ + Epoch: 31, + Root: bytesutil.PadTo([]byte("cjcroot"), 32), + } + state.FinalizedCheckpoint = ðpbalpha.Checkpoint{ + Epoch: 32, + Root: bytesutil.PadTo([]byte("fcroot"), 32), + } + state.PreviousEpochParticipation = []byte("previousepochparticipation") + state.CurrentEpochParticipation = []byte("currentepochparticipation") + state.InactivityScores = []uint64{1, 2, 3} + state.CurrentSyncCommittee = ðpbalpha.SyncCommittee{ + Pubkeys: [][]byte{bytesutil.PadTo([]byte("cscpubkeys"), 48)}, + AggregatePubkey: bytesutil.PadTo([]byte("cscaggregatepubkey"), 48), + } + state.NextSyncCommittee = ðpbalpha.SyncCommittee{ + Pubkeys: [][]byte{bytesutil.PadTo([]byte("nscpubkeys"), 48)}, + AggregatePubkey: bytesutil.PadTo([]byte("nscaggregatepubkey"), 48), + } + state.LatestExecutionPayloadHeader = &enginev1.ExecutionPayloadHeaderDeneb{ + ParentHash: bytesutil.PadTo([]byte("parenthash"), 32), + FeeRecipient: bytesutil.PadTo([]byte("feerecipient"), 20), + StateRoot: bytesutil.PadTo([]byte("stateroot"), 32), + ReceiptsRoot: bytesutil.PadTo([]byte("receiptroot"), 32), + LogsBloom: bytesutil.PadTo([]byte("logsbloom"), 256), + PrevRandao: bytesutil.PadTo([]byte("prevrandao"), 32), + BlockNumber: 123, + GasLimit: 456, + GasUsed: 789, + Timestamp: 012, + ExtraData: []byte("extradata"), + BaseFeePerGas: bytesutil.PadTo([]byte("basefeepergas"), 32), + BlockHash: bytesutil.PadTo([]byte("blockhash"), 32), + TransactionsRoot: bytesutil.PadTo([]byte("transactionsroot"), 32), + WithdrawalsRoot: bytesutil.PadTo([]byte("withdrawalsroot"), 32), + ExcessDataGas: bytesutil.PadTo([]byte("excessdatagas"), 32), + } + state.NextWithdrawalIndex = 123 + state.NextWithdrawalValidatorIndex = 123 + state.HistoricalSummaries = []*ethpbalpha.HistoricalSummary{ + { + BlockSummaryRoot: bytesutil.PadTo([]byte("blocksummaryroot"), 32), + StateSummaryRoot: bytesutil.PadTo([]byte("statesummaryroot"), 32), + }, + { + BlockSummaryRoot: bytesutil.PadTo([]byte("blocksummaryroot2"), 32), + StateSummaryRoot: bytesutil.PadTo([]byte("statesummaryroot2"), 32), + }} + return nil + }) + require.NoError(t, err) + + result, err := BeaconStateDenebToProto(source) + require.NoError(t, err) + require.NotNil(t, result) + assert.Equal(t, uint64(1), result.GenesisTime) + assert.DeepEqual(t, bytesutil.PadTo([]byte("genesisvalidatorsroot"), 32), result.GenesisValidatorsRoot) + assert.Equal(t, primitives.Slot(2), result.Slot) + resultFork := result.Fork + require.NotNil(t, resultFork) + assert.DeepEqual(t, bytesutil.PadTo([]byte("123"), 4), resultFork.PreviousVersion) + assert.DeepEqual(t, bytesutil.PadTo([]byte("456"), 4), resultFork.CurrentVersion) + assert.Equal(t, primitives.Epoch(3), resultFork.Epoch) + resultLatestBlockHeader := result.LatestBlockHeader + require.NotNil(t, resultLatestBlockHeader) + assert.Equal(t, primitives.Slot(4), resultLatestBlockHeader.Slot) + assert.Equal(t, primitives.ValidatorIndex(5), resultLatestBlockHeader.ProposerIndex) + assert.DeepEqual(t, bytesutil.PadTo([]byte("lbhparentroot"), 32), resultLatestBlockHeader.ParentRoot) + assert.DeepEqual(t, bytesutil.PadTo([]byte("lbhstateroot"), 32), resultLatestBlockHeader.StateRoot) + assert.DeepEqual(t, bytesutil.PadTo([]byte("lbhbodyroot"), 32), resultLatestBlockHeader.BodyRoot) + assert.Equal(t, 8192, len(result.BlockRoots)) + assert.DeepEqual(t, bytesutil.PadTo([]byte("blockroots"), 32), result.BlockRoots[0]) + assert.Equal(t, 8192, len(result.StateRoots)) + assert.DeepEqual(t, bytesutil.PadTo([]byte("stateroots"), 32), result.StateRoots[0]) + resultEth1Data := result.Eth1Data + require.NotNil(t, resultEth1Data) + assert.DeepEqual(t, bytesutil.PadTo([]byte("e1ddepositroot"), 32), resultEth1Data.DepositRoot) + assert.Equal(t, uint64(6), resultEth1Data.DepositCount) + assert.DeepEqual(t, bytesutil.PadTo([]byte("e1dblockhash"), 32), resultEth1Data.BlockHash) + require.Equal(t, 1, len(result.Eth1DataVotes)) + resultEth1DataVote := result.Eth1DataVotes[0] + require.NotNil(t, resultEth1DataVote) + assert.DeepEqual(t, bytesutil.PadTo([]byte("e1dvdepositroot"), 32), resultEth1DataVote.DepositRoot) + assert.Equal(t, uint64(7), resultEth1DataVote.DepositCount) + assert.DeepEqual(t, bytesutil.PadTo([]byte("e1dvblockhash"), 32), resultEth1DataVote.BlockHash) + assert.Equal(t, uint64(8), result.Eth1DepositIndex) + require.Equal(t, 1, len(result.Validators)) + resultValidator := result.Validators[0] + require.NotNil(t, resultValidator) + assert.DeepEqual(t, bytesutil.PadTo([]byte("publickey"), 48), resultValidator.Pubkey) + assert.DeepEqual(t, bytesutil.PadTo([]byte("withdrawalcredentials"), 32), resultValidator.WithdrawalCredentials) + assert.Equal(t, uint64(9), resultValidator.EffectiveBalance) + assert.Equal(t, true, resultValidator.Slashed) + assert.Equal(t, primitives.Epoch(10), resultValidator.ActivationEligibilityEpoch) + assert.Equal(t, primitives.Epoch(11), resultValidator.ActivationEpoch) + assert.Equal(t, primitives.Epoch(12), resultValidator.ExitEpoch) + assert.Equal(t, primitives.Epoch(13), resultValidator.WithdrawableEpoch) + assert.DeepEqual(t, []uint64{14}, result.Balances) + assert.Equal(t, 65536, len(result.RandaoMixes)) + assert.DeepEqual(t, bytesutil.PadTo([]byte("randaomixes"), 32), result.RandaoMixes[0]) + assert.DeepEqual(t, []uint64{15}, result.Slashings) + assert.DeepEqual(t, bitfield.Bitvector4{1}, result.JustificationBits) + resultPrevJustifiedCheckpoint := result.PreviousJustifiedCheckpoint + require.NotNil(t, resultPrevJustifiedCheckpoint) + assert.Equal(t, primitives.Epoch(30), resultPrevJustifiedCheckpoint.Epoch) + assert.DeepEqual(t, bytesutil.PadTo([]byte("pjcroot"), 32), resultPrevJustifiedCheckpoint.Root) + resultCurrJustifiedCheckpoint := result.CurrentJustifiedCheckpoint + require.NotNil(t, resultCurrJustifiedCheckpoint) + assert.Equal(t, primitives.Epoch(31), resultCurrJustifiedCheckpoint.Epoch) + assert.DeepEqual(t, bytesutil.PadTo([]byte("cjcroot"), 32), resultCurrJustifiedCheckpoint.Root) + resultFinalizedCheckpoint := result.FinalizedCheckpoint + require.NotNil(t, resultFinalizedCheckpoint) + assert.Equal(t, primitives.Epoch(32), resultFinalizedCheckpoint.Epoch) + assert.DeepEqual(t, bytesutil.PadTo([]byte("fcroot"), 32), resultFinalizedCheckpoint.Root) + assert.DeepEqual(t, []byte("previousepochparticipation"), result.PreviousEpochParticipation) + assert.DeepEqual(t, []byte("currentepochparticipation"), result.CurrentEpochParticipation) + assert.DeepEqual(t, []uint64{1, 2, 3}, result.InactivityScores) + require.NotNil(t, result.CurrentSyncCommittee) + assert.DeepEqual(t, [][]byte{bytesutil.PadTo([]byte("cscpubkeys"), 48)}, result.CurrentSyncCommittee.Pubkeys) + assert.DeepEqual(t, bytesutil.PadTo([]byte("cscaggregatepubkey"), 48), result.CurrentSyncCommittee.AggregatePubkey) + require.NotNil(t, result.NextSyncCommittee) + assert.DeepEqual(t, [][]byte{bytesutil.PadTo([]byte("nscpubkeys"), 48)}, result.NextSyncCommittee.Pubkeys) + assert.DeepEqual(t, bytesutil.PadTo([]byte("nscaggregatepubkey"), 48), result.NextSyncCommittee.AggregatePubkey) + resultLatestExecutionPayloadHeader := result.LatestExecutionPayloadHeader + require.NotNil(t, resultLatestExecutionPayloadHeader) + assert.DeepEqual(t, bytesutil.PadTo([]byte("parenthash"), 32), resultLatestExecutionPayloadHeader.ParentHash) + assert.DeepEqual(t, bytesutil.PadTo([]byte("feerecipient"), 20), resultLatestExecutionPayloadHeader.FeeRecipient) + assert.DeepEqual(t, bytesutil.PadTo([]byte("stateroot"), 32), resultLatestExecutionPayloadHeader.StateRoot) + assert.DeepEqual(t, bytesutil.PadTo([]byte("receiptroot"), 32), resultLatestExecutionPayloadHeader.ReceiptsRoot) + assert.DeepEqual(t, bytesutil.PadTo([]byte("logsbloom"), 256), resultLatestExecutionPayloadHeader.LogsBloom) + assert.DeepEqual(t, bytesutil.PadTo([]byte("prevrandao"), 32), resultLatestExecutionPayloadHeader.PrevRandao) + assert.Equal(t, uint64(123), resultLatestExecutionPayloadHeader.BlockNumber) + assert.Equal(t, uint64(456), resultLatestExecutionPayloadHeader.GasLimit) + assert.Equal(t, uint64(789), resultLatestExecutionPayloadHeader.GasUsed) + assert.Equal(t, uint64(012), resultLatestExecutionPayloadHeader.Timestamp) + assert.DeepEqual(t, []byte("extradata"), resultLatestExecutionPayloadHeader.ExtraData) + assert.DeepEqual(t, bytesutil.PadTo([]byte("basefeepergas"), 32), resultLatestExecutionPayloadHeader.BaseFeePerGas) + assert.DeepEqual(t, bytesutil.PadTo([]byte("blockhash"), 32), resultLatestExecutionPayloadHeader.BlockHash) + assert.DeepEqual(t, bytesutil.PadTo([]byte("transactionsroot"), 32), resultLatestExecutionPayloadHeader.TransactionsRoot) + assert.DeepEqual(t, bytesutil.PadTo([]byte("withdrawalsroot"), 32), resultLatestExecutionPayloadHeader.WithdrawalsRoot) + assert.DeepEqual(t, bytesutil.PadTo([]byte("excessdatagas"), 32), resultLatestExecutionPayloadHeader.ExcessDataGas) + assert.Equal(t, uint64(123), result.NextWithdrawalIndex) + assert.Equal(t, primitives.ValidatorIndex(123), result.NextWithdrawalValidatorIndex) + assert.DeepEqual(t, bytesutil.PadTo([]byte("blocksummaryroot"), 32), result.HistoricalSummaries[0].BlockSummaryRoot) + assert.DeepEqual(t, bytesutil.PadTo([]byte("statesummaryroot"), 32), result.HistoricalSummaries[0].StateSummaryRoot) + assert.DeepEqual(t, bytesutil.PadTo([]byte("blocksummaryroot2"), 32), result.HistoricalSummaries[1].BlockSummaryRoot) + assert.DeepEqual(t, bytesutil.PadTo([]byte("statesummaryroot2"), 32), result.HistoricalSummaries[1].StateSummaryRoot) +} + func TestV1Alpha1SignedBLSToExecChangeToV2(t *testing.T) { alphaChange := ðpbalpha.SignedBLSToExecutionChange{ Message: ðpbalpha.BLSToExecutionChange{ diff --git a/testing/util/state.go b/testing/util/state.go index 8706f38070f0..17f953cbb6f6 100644 --- a/testing/util/state.go +++ b/testing/util/state.go @@ -71,6 +71,19 @@ func FillRootsNaturalOptCapella(state *ethpb.BeaconStateCapella) error { return nil } +// FillRootsNaturalOptDeneb is meant to be used as an option when calling NewBeaconStateDeneb. +// It fills state and block roots with hex representations of natural numbers starting with 0. +// Example: 16 becomes 0x00...0f. +func FillRootsNaturalOptDeneb(state *ethpb.BeaconStateDeneb) error { + roots, err := PrepareRoots(int(params.BeaconConfig().SlotsPerHistoricalRoot)) + if err != nil { + return err + } + state.StateRoots = roots + state.BlockRoots = roots + return nil +} + type NewBeaconStateOption func(state *ethpb.BeaconState) error // NewBeaconState creates a beacon state with minimum marshalable fields. @@ -305,6 +318,75 @@ func NewBeaconStateCapella(options ...func(state *ethpb.BeaconStateCapella) erro return st.Copy(), nil } +// NewBeaconStateDeneb creates a beacon state with minimum marshalable fields. +func NewBeaconStateDeneb(options ...func(state *ethpb.BeaconStateDeneb) error) (state.BeaconState, error) { + pubkeys := make([][]byte, 512) + for i := range pubkeys { + pubkeys[i] = make([]byte, 48) + } + + seed := ðpb.BeaconStateDeneb{ + BlockRoots: filledByteSlice2D(uint64(params.BeaconConfig().SlotsPerHistoricalRoot), 32), + StateRoots: filledByteSlice2D(uint64(params.BeaconConfig().SlotsPerHistoricalRoot), 32), + Slashings: make([]uint64, params.BeaconConfig().EpochsPerSlashingsVector), + RandaoMixes: filledByteSlice2D(uint64(params.BeaconConfig().EpochsPerHistoricalVector), 32), + Validators: make([]*ethpb.Validator, 0), + CurrentJustifiedCheckpoint: ðpb.Checkpoint{Root: make([]byte, fieldparams.RootLength)}, + Eth1Data: ðpb.Eth1Data{ + DepositRoot: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, 32), + }, + Fork: ðpb.Fork{ + PreviousVersion: make([]byte, 4), + CurrentVersion: make([]byte, 4), + }, + Eth1DataVotes: make([]*ethpb.Eth1Data, 0), + HistoricalRoots: make([][]byte, 0), + JustificationBits: bitfield.Bitvector4{0x0}, + FinalizedCheckpoint: ðpb.Checkpoint{Root: make([]byte, fieldparams.RootLength)}, + LatestBlockHeader: HydrateBeaconHeader(ðpb.BeaconBlockHeader{}), + PreviousJustifiedCheckpoint: ðpb.Checkpoint{Root: make([]byte, fieldparams.RootLength)}, + PreviousEpochParticipation: make([]byte, 0), + CurrentEpochParticipation: make([]byte, 0), + CurrentSyncCommittee: ðpb.SyncCommittee{ + Pubkeys: pubkeys, + AggregatePubkey: make([]byte, 48), + }, + NextSyncCommittee: ðpb.SyncCommittee{ + Pubkeys: pubkeys, + AggregatePubkey: make([]byte, 48), + }, + LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderDeneb{ + ParentHash: make([]byte, 32), + FeeRecipient: make([]byte, 20), + StateRoot: make([]byte, 32), + ReceiptsRoot: make([]byte, 32), + LogsBloom: make([]byte, 256), + PrevRandao: make([]byte, 32), + ExtraData: make([]byte, 0), + BaseFeePerGas: make([]byte, 32), + BlockHash: make([]byte, 32), + TransactionsRoot: make([]byte, 32), + WithdrawalsRoot: make([]byte, 32), + ExcessDataGas: make([]byte, 32), + }, + } + + for _, opt := range options { + err := opt(seed) + if err != nil { + return nil, err + } + } + + var st, err = state_native.InitializeFromProtoUnsafeDeneb(seed) + if err != nil { + return nil, err + } + + return st.Copy(), nil +} + // SSZ will fill 2D byte slices with their respective values, so we must fill these in too for round // trip testing. func filledByteSlice2D(length, innerLen uint64) [][]byte { diff --git a/testing/util/state_test.go b/testing/util/state_test.go index 02330182c5ad..e260caeb1505 100644 --- a/testing/util/state_test.go +++ b/testing/util/state_test.go @@ -2,10 +2,10 @@ package util import ( "context" - "reflect" "testing" ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v4/testing/assert" "github.com/prysmaticlabs/prysm/v4/testing/require" ) @@ -16,9 +16,7 @@ func TestNewBeaconState(t *testing.T) { require.NoError(t, err) got := ðpb.BeaconState{} require.NoError(t, got.UnmarshalSSZ(b)) - if !reflect.DeepEqual(st.ToProtoUnsafe(), got) { - t.Fatal("State did not match after round trip marshal") - } + assert.DeepEqual(t, st.ToProtoUnsafe(), got) } func TestNewBeaconStateAltair(t *testing.T) { @@ -28,9 +26,7 @@ func TestNewBeaconStateAltair(t *testing.T) { require.NoError(t, err) got := ðpb.BeaconStateAltair{} require.NoError(t, got.UnmarshalSSZ(b)) - if !reflect.DeepEqual(st.ToProtoUnsafe(), got) { - t.Fatal("State did not match after round trip marshal") - } + assert.DeepEqual(t, st.ToProtoUnsafe(), got) } func TestNewBeaconStateBellatrix(t *testing.T) { @@ -40,9 +36,7 @@ func TestNewBeaconStateBellatrix(t *testing.T) { require.NoError(t, err) got := ðpb.BeaconStateBellatrix{} require.NoError(t, got.UnmarshalSSZ(b)) - if !reflect.DeepEqual(st.ToProtoUnsafe(), got) { - t.Fatal("State did not match after round trip marshal") - } + assert.DeepEqual(t, st.ToProtoUnsafe(), got) } func TestNewBeaconStateCapella(t *testing.T) { @@ -52,9 +46,17 @@ func TestNewBeaconStateCapella(t *testing.T) { require.NoError(t, err) got := ðpb.BeaconStateCapella{} require.NoError(t, got.UnmarshalSSZ(b)) - if !reflect.DeepEqual(st.ToProtoUnsafe(), got) { - t.Fatal("State did not match after round trip marshal") - } + assert.DeepEqual(t, st.ToProtoUnsafe(), got) +} + +func TestNewBeaconStateDeneb(t *testing.T) { + st, err := NewBeaconStateDeneb() + require.NoError(t, err) + b, err := st.MarshalSSZ() + require.NoError(t, err) + got := ðpb.BeaconStateDeneb{} + require.NoError(t, got.UnmarshalSSZ(b)) + assert.DeepEqual(t, st.ToProtoUnsafe(), got) } func TestNewBeaconState_HashTreeRoot(t *testing.T) {