From bd4d7b11957932035c63df3636f5f29ba62af508 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 7 Mar 2023 21:03:26 -0600 Subject: [PATCH 01/31] wip implementation --- beacon-chain/rpc/apimiddleware/custom_handlers.go | 3 +++ beacon-chain/rpc/eth/events/events.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/beacon-chain/rpc/apimiddleware/custom_handlers.go b/beacon-chain/rpc/apimiddleware/custom_handlers.go index 91d384224e80..fb980eb2b50d 100644 --- a/beacon-chain/rpc/apimiddleware/custom_handlers.go +++ b/beacon-chain/rpc/apimiddleware/custom_handlers.go @@ -14,6 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v3/api/gateway/apimiddleware" "github.com/prysmaticlabs/prysm/v3/api/grpc" "github.com/prysmaticlabs/prysm/v3/beacon-chain/rpc/eth/events" + enginev1 "github.com/prysmaticlabs/prysm/v3/proto/engine/v1" "github.com/r3labs/sse" ) @@ -418,6 +419,8 @@ func receiveEvents(eventChan <-chan *sse.Event, w http.ResponseWriter, req *http data = &SignedContributionAndProofJson{} case events.BLSToExecutionChangeTopic: data = &SignedBLSToExecutionChangeJson{} + case events.PayloadAttributesTopic: + data = &enginev1.PayloadAttributesV2{} case "error": data = &EventErrorJson{} default: diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 0ebf40093a6d..f29dfff80d2c 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -35,6 +35,8 @@ const ( SyncCommitteeContributionTopic = "contribution_and_proof" // BLSToExecutionChangeTopic represents a new received BLS to execution change event topic. BLSToExecutionChangeTopic = "bls_to_execution_change" + // PayloadAttributesTopic represents a new payload attributes for execution payload building event topic. + PayloadAttributesTopic = "payload_attributes" ) var casesHandled = map[string]bool{ @@ -46,6 +48,7 @@ var casesHandled = map[string]bool{ ChainReorgTopic: true, SyncCommitteeContributionTopic: true, BLSToExecutionChangeTopic: true, + PayloadAttributesTopic: true, } // StreamEvents allows requesting all events from a set of topics defined in the Ethereum consensus API standard. From 9a72e84195658eeb1fc56eece02cab68dcf34981 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 7 Mar 2023 21:18:47 -0600 Subject: [PATCH 02/31] wip implementation --- beacon-chain/blockchain/execution_engine.go | 10 ++++++++++ beacon-chain/core/feed/state/events.go | 2 ++ beacon-chain/rpc/apimiddleware/custom_handlers.go | 3 +-- beacon-chain/rpc/eth/events/events.go | 7 +++++++ proto/eth/v1/events.proto | 8 ++++++++ 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 1a310b78188e..06a97dc4eef4 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -6,6 +6,8 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/blocks" + "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed" + statefeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/state" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/transition" @@ -19,6 +21,7 @@ import ( "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v3/encoding/bytesutil" enginev1 "github.com/prysmaticlabs/prysm/v3/proto/engine/v1" + ethpbv1 "github.com/prysmaticlabs/prysm/v3/proto/eth/v1" "github.com/prysmaticlabs/prysm/v3/runtime/version" "github.com/prysmaticlabs/prysm/v3/time/slots" "github.com/sirupsen/logrus" @@ -144,6 +147,12 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho } } forkchoiceUpdatedValidNodeCount.Inc() + + s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ + Type: statefeed.PayloadAttributeSent, + Data: ðpbv1.EventHead{}, + }) + if err := s.cfg.ForkChoiceStore.SetOptimisticToValid(ctx, arg.headRoot); err != nil { log.WithError(err).Error("Could not set head root to valid") return nil, nil @@ -210,6 +219,7 @@ func (s *Service) notifyNewPayload(ctx context.Context, postStateVersion int, switch err { case nil: newPayloadValidNodeCount.Inc() + blk.Version() return true, nil case execution.ErrAcceptedSyncingPayloadStatus: newPayloadOptimisticNodeCount.Inc() diff --git a/beacon-chain/core/feed/state/events.go b/beacon-chain/core/feed/state/events.go index 2b1364691755..5974bb56293f 100644 --- a/beacon-chain/core/feed/state/events.go +++ b/beacon-chain/core/feed/state/events.go @@ -26,6 +26,8 @@ const ( FinalizedCheckpoint // NewHead of the chain event. NewHead + // PayloadAttributeSent is sent when a node computed a new payload attributes for execution payload building + PayloadAttributeSent ) // BlockProcessedData is the data sent with BlockProcessed events. diff --git a/beacon-chain/rpc/apimiddleware/custom_handlers.go b/beacon-chain/rpc/apimiddleware/custom_handlers.go index fb980eb2b50d..80f5a13105b9 100644 --- a/beacon-chain/rpc/apimiddleware/custom_handlers.go +++ b/beacon-chain/rpc/apimiddleware/custom_handlers.go @@ -14,7 +14,6 @@ import ( "github.com/prysmaticlabs/prysm/v3/api/gateway/apimiddleware" "github.com/prysmaticlabs/prysm/v3/api/grpc" "github.com/prysmaticlabs/prysm/v3/beacon-chain/rpc/eth/events" - enginev1 "github.com/prysmaticlabs/prysm/v3/proto/engine/v1" "github.com/r3labs/sse" ) @@ -420,7 +419,7 @@ func receiveEvents(eventChan <-chan *sse.Event, w http.ResponseWriter, req *http case events.BLSToExecutionChangeTopic: data = &SignedBLSToExecutionChangeJson{} case events.PayloadAttributesTopic: - data = &enginev1.PayloadAttributesV2{} + //data = &enginev1.PayloadAttributesV2{} case "error": data = &EventErrorJson{} default: diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index f29dfff80d2c..7f85af9e8ee2 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -194,6 +194,7 @@ func handleBlockOperationEvents( } v2Change := migration.V1Alpha1SignedBLSToExecChangeToV2(changeData.Change) return streamData(stream, BLSToExecutionChangeTopic, v2Change) + default: return nil } @@ -230,6 +231,12 @@ func handleStateEvents( return nil } return streamData(stream, ChainReorgTopic, reorg) + case statefeed.PayloadAttributeSent: + if _, ok := requestedTopics[PayloadAttributesTopic]; !ok { + return nil + } + + return streamData(stream, PayloadAttributesTopic, nil) default: return nil } diff --git a/proto/eth/v1/events.proto b/proto/eth/v1/events.proto index 6129cc88d124..39694c2fe9f3 100644 --- a/proto/eth/v1/events.proto +++ b/proto/eth/v1/events.proto @@ -104,3 +104,11 @@ message EventFinalizedCheckpoint { // Information about optimistic sync. bool execution_optimistic = 4; } + +message EventPayloadAttributeV1 { + +} + +message EventPayloadAttributeV2 { + +} \ No newline at end of file From 21329141c4b1bf308154068a12f29f0787d53745 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Wed, 8 Mar 2023 07:40:03 -0600 Subject: [PATCH 03/31] WIP change --- beacon-chain/blockchain/execution_engine.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 06a97dc4eef4..1368dd5a3579 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -147,11 +147,6 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho } } forkchoiceUpdatedValidNodeCount.Inc() - - s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ - Type: statefeed.PayloadAttributeSent, - Data: ðpbv1.EventHead{}, - }) if err := s.cfg.ForkChoiceStore.SetOptimisticToValid(ctx, arg.headRoot); err != nil { log.WithError(err).Error("Could not set head root to valid") @@ -171,6 +166,19 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho return payloadID, nil } +// notifyPayloadAttributesStream on successful FCU notify the event stream that a payload was sent +func (s *Service) notifyPayloadAttributesStream(ctx context.Context, arg *notifyForkchoiceUpdateArg, proposerIndex primitives.ValidatorIndex, attrs payloadattribute.Attributer) error { + parentBlockRoot := arg.headRoot // parent root + proposalSlot := s.CurrentSlot() + 1 // slot used for payload + parentBlockNumber := arg.headBlock.Slot() + + s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ + Type: statefeed.PayloadAttributeSent, + Data: ðpbv1.EventHead{}, + }) + return nil +} + // getPayloadHash returns the payload hash given the block root. // if the block is before bellatrix fork epoch, it returns the zero hash. func (s *Service) getPayloadHash(ctx context.Context, root []byte) ([32]byte, error) { From 07e587020e7f86f651a6f82441056eee7aab2b33 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Wed, 8 Mar 2023 11:29:12 -0600 Subject: [PATCH 04/31] wip proto --- proto/eth/v1/events.proto | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/proto/eth/v1/events.proto b/proto/eth/v1/events.proto index 39694c2fe9f3..e2567044063c 100644 --- a/proto/eth/v1/events.proto +++ b/proto/eth/v1/events.proto @@ -106,7 +106,15 @@ message EventFinalizedCheckpoint { } message EventPayloadAttributeV1 { - + // the identifier of the beacon hard fork at `proposal_slot`, e.g.`"bellatrix"`, `"capella"`. + string version = 1; + // The slot at which a block using these payload attributes may be built. + uint64 proposal_slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + // The previous dependent root. + bytes parent_block_root = 5 [(ethereum.eth.ext.ssz_size) = "32"]; + bytes parent_block_hash = 13 [(ethereum.eth.ext.ssz_size) = "32"]; + // Validator index of the validator that proposed the block header. + uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"]; } message EventPayloadAttributeV2 { From 869628b321de8f46247d22627fc6f21544315d9e Mon Sep 17 00:00:00 2001 From: james-prysm Date: Wed, 8 Mar 2023 11:57:38 -0600 Subject: [PATCH 05/31] wip proto --- beacon-chain/blockchain/execution_engine.go | 4 +- proto/eth/v1/events.proto | 51 ++++++++++++++++++--- 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 1368dd5a3579..c8e1fdb2f215 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -171,8 +171,8 @@ func (s *Service) notifyPayloadAttributesStream(ctx context.Context, arg *notify parentBlockRoot := arg.headRoot // parent root proposalSlot := s.CurrentSlot() + 1 // slot used for payload parentBlockNumber := arg.headBlock.Slot() - - s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ + attrs. + s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ Type: statefeed.PayloadAttributeSent, Data: ðpbv1.EventHead{}, }) diff --git a/proto/eth/v1/events.proto b/proto/eth/v1/events.proto index e2567044063c..7d4482d3e71a 100644 --- a/proto/eth/v1/events.proto +++ b/proto/eth/v1/events.proto @@ -17,6 +17,7 @@ package ethereum.eth.v1; import "google/protobuf/descriptor.proto"; import "proto/eth/ext/options.proto"; +import "proto/engine/v1/execution_engine.proto"; option csharp_namespace = "Ethereum.Eth.V1"; option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v1"; @@ -106,17 +107,53 @@ message EventFinalizedCheckpoint { } message EventPayloadAttributeV1 { - // the identifier of the beacon hard fork at `proposal_slot`, e.g.`"bellatrix"`, `"capella"`. + // the identifier of the beacon hard fork at `proposal_slot`, e.g.`"bellatrix"`. string version = 1; + // The slot at which a block using these payload attributes may be built. - uint64 proposal_slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; - // The previous dependent root. - bytes parent_block_root = 5 [(ethereum.eth.ext.ssz_size) = "32"]; - bytes parent_block_hash = 13 [(ethereum.eth.ext.ssz_size) = "32"]; - // Validator index of the validator that proposed the block header. - uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"]; + uint64 proposal_slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + + // The execution block number of the parent block, which is also the Slot number. + uint64 parent_block_number = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + + // The beacon block root of the parent block to be built upon. + bytes parent_block_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; + + // The execution block hash of the parent block. + bytes parent_block_hash = 5 [(ethereum.eth.ext.ssz_size) = "32"]; + + // The validator index of the proposer at proposal_slot on the chain identified by parent_block_root. + uint64 proposer_index = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"]; + + // payload_attributes: beacon API encoding of PayloadAttributesV as defined by the execution-apis specification. + // The version N must match the payload attributes for the hard fork matching version. + // The beacon API encoded object must have equivalent fields to its counterpart in execution-apis with two differences: + // 1) snake_case identifiers must be used rather than camelCase; 2) integers must be encoded as quoted decimals rather than big-endian hex. + PayloadAttributes payload_attributes = 7 } message EventPayloadAttributeV2 { + // the identifier of the beacon hard fork at `proposal_slot`, e.g. `"capella"`. + string version = 1; + + // The slot at which a block using these payload attributes may be built. + uint64 proposal_slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + + // The execution block number of the parent block, which is also the Slot number. + uint64 parent_block_number = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + + // The beacon block root of the parent block to be built upon. + bytes parent_block_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; + + // The execution block hash of the parent block. + bytes parent_block_hash = 5 [(ethereum.eth.ext.ssz_size) = "32"]; + + // The validator index of the proposer at proposal_slot on the chain identified by parent_block_root. + uint64 proposer_index = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"]; + // payload_attributes: beacon API encoding of PayloadAttributesV as defined by the execution-apis specification. + // The version N must match the payload attributes for the hard fork matching version. + // The beacon API encoded object must have equivalent fields to its counterpart in execution-apis with two differences: + // 1) snake_case identifiers must be used rather than camelCase; 2) integers must be encoded as quoted decimals rather than big-endian hex. + PayloadAttributesV2 payload_attributes = 7 } \ No newline at end of file From c6d266ada769856fab568a4d93afd417c5688009 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Wed, 8 Mar 2023 17:17:15 -0600 Subject: [PATCH 06/31] added changes for events to notify Payload changes --- beacon-chain/blockchain/execution_engine.go | 55 +- .../rpc/apimiddleware/custom_handlers.go | 19 +- beacon-chain/rpc/apimiddleware/structs.go | 30 ++ beacon-chain/rpc/eth/events/events.go | 11 +- proto/eth/v1/BUILD.bazel | 4 + proto/eth/v1/events.pb.go | 483 ++++++++++++++---- proto/eth/v1/events.proto | 68 +-- 7 files changed, 532 insertions(+), 138 deletions(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index c8e1fdb2f215..503ad6b0476d 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -152,11 +152,16 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho log.WithError(err).Error("Could not set head root to valid") return nil, nil } + // If the forkchoice update call has an attribute, update the proposer payload ID cache. if hasAttr && payloadID != nil { var pId [8]byte copy(pId[:], payloadID[:]) s.cfg.ProposerSlotIndexCache.SetProposerAndPayloadIDs(nextSlot, proposerId, pId, arg.headRoot) + // On successful FCU notify that the payload was sent to the event stream. + if err := s.notifyPayloadAttributesStream(proposerId, arg.headBlock.Slot(), arg.headRoot[:], headPayload.BlockHash(), attr); err != nil { + return nil, err + } } else if hasAttr && payloadID == nil { log.WithFields(logrus.Fields{ "blockHash": fmt.Sprintf("%#x", headPayload.BlockHash()), @@ -167,16 +172,48 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho } // notifyPayloadAttributesStream on successful FCU notify the event stream that a payload was sent -func (s *Service) notifyPayloadAttributesStream(ctx context.Context, arg *notifyForkchoiceUpdateArg, proposerIndex primitives.ValidatorIndex, attrs payloadattribute.Attributer) error { - parentBlockRoot := arg.headRoot // parent root - proposalSlot := s.CurrentSlot() + 1 // slot used for payload - parentBlockNumber := arg.headBlock.Slot() - attrs. +func (s *Service) notifyPayloadAttributesStream(proposerIndex primitives.ValidatorIndex, + parentBlockNumber primitives.Slot, parentBlockRoot []byte, parentBlockHash []byte, attrs payloadattribute.Attributer) error { + switch attrs.Version() { + case version.Bellatrix: + pbv1, err := attrs.PbV1() + if err != nil { + return err + } s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ - Type: statefeed.PayloadAttributeSent, - Data: ðpbv1.EventHead{}, - }) - return nil + Type: statefeed.PayloadAttributeSent, + Data: ðpbv1.EventPayloadAttributeV1{ + Version: version.String(attrs.Version()), + ProposerIndex: proposerIndex, + ProposalSlot: s.CurrentSlot() + 1, + ParentBlockNumber: parentBlockNumber, + ParentBlockRoot: parentBlockRoot, + ParentBlockHash: parentBlockHash, + PayloadAttributes: pbv1, + }, + }) + return nil + case version.Capella: + pbv2, err := attrs.PbV2() + if err != nil { + return err + } + s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ + Type: statefeed.PayloadAttributeSent, + Data: ðpbv1.EventPayloadAttributeV2{ + Version: version.String(attrs.Version()), + ProposerIndex: proposerIndex, + ProposalSlot: s.CurrentSlot() + 1, + ParentBlockNumber: parentBlockNumber, + ParentBlockRoot: parentBlockRoot, + ParentBlockHash: parentBlockHash, + PayloadAttributes: pbv2, + }, + }) + return nil + default: + return errors.New("payload version is not supported") + } } // getPayloadHash returns the payload hash given the block root. diff --git a/beacon-chain/rpc/apimiddleware/custom_handlers.go b/beacon-chain/rpc/apimiddleware/custom_handlers.go index 80f5a13105b9..148ef122cd24 100644 --- a/beacon-chain/rpc/apimiddleware/custom_handlers.go +++ b/beacon-chain/rpc/apimiddleware/custom_handlers.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/base64" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -14,6 +15,7 @@ import ( "github.com/prysmaticlabs/prysm/v3/api/gateway/apimiddleware" "github.com/prysmaticlabs/prysm/v3/api/grpc" "github.com/prysmaticlabs/prysm/v3/beacon-chain/rpc/eth/events" + "github.com/prysmaticlabs/prysm/v3/runtime/version" "github.com/r3labs/sse" ) @@ -364,6 +366,10 @@ func handleEvents(m *apimiddleware.ApiProxyMiddleware, _ apimiddleware.Endpoint, return true } +type dataSubset struct { + Version string `json:"version"` +} + func receiveEvents(eventChan <-chan *sse.Event, w http.ResponseWriter, req *http.Request) apimiddleware.ErrorJson { for { select { @@ -419,7 +425,18 @@ func receiveEvents(eventChan <-chan *sse.Event, w http.ResponseWriter, req *http case events.BLSToExecutionChangeTopic: data = &SignedBLSToExecutionChangeJson{} case events.PayloadAttributesTopic: - //data = &enginev1.PayloadAttributesV2{} + dataSubset := &dataSubset{} + if err := json.Unmarshal(msg.Data, dataSubset); err != nil { + return apimiddleware.InternalServerError(err) + } + switch dataSubset.Version { + case version.String(version.Bellatrix): + data = &EventPayloadAttributeV1Json{} + case version.String(version.Capella): + data = &EventPayloadAttributeV2Json{} + default: + return apimiddleware.InternalServerError(errors.New("payload version unsupported")) + } case "error": data = &EventErrorJson{} default: diff --git a/beacon-chain/rpc/apimiddleware/structs.go b/beacon-chain/rpc/apimiddleware/structs.go index fed59db71ace..45a1c038db93 100644 --- a/beacon-chain/rpc/apimiddleware/structs.go +++ b/beacon-chain/rpc/apimiddleware/structs.go @@ -1160,6 +1160,36 @@ type EventChainReorgJson struct { ExecutionOptimistic bool `json:"execution_optimistic"` } +type EventPayloadAttributeBaseJson struct { + Version string `json:"version"` + ProposerIndex string `json:"proposer_index"` + ProposalSlot string `json:"proposal_slot"` + ParentBlockNumber string `json:"parent_block_number"` + ParentBlockRoot string `json:"parent_block_root" hex:"true"` + ParentBlockHash string `json:"parent_block_hash" hex:"true"` +} + +type EventPayloadAttributeV1Json struct { + EventPayloadAttributeBaseJson + PayloadAttributes *PayloadAttributesV1Json `json:"payload_attributes"` +} + +type EventPayloadAttributeV2Json struct { + EventPayloadAttributeBaseJson + PayloadAttributes *PayloadAttributesV2Json `json:"payload_attributes"` +} + +type PayloadAttributesV1Json struct { + Timestamp string `json:"timestamp"` + Random string `json:"prev_randao" hex:"true"` + SuggestedFeeRecipient string `json:"suggested_fee_recipient" hex:"true"` +} + +type PayloadAttributesV2Json struct { + PayloadAttributesV1Json + Withdrawals []*WithdrawalJson `json:"withdrawals"` +} + // --------------- // Error handling. // --------------- diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 7f85af9e8ee2..c070412f92af 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -235,8 +235,17 @@ func handleStateEvents( if _, ok := requestedTopics[PayloadAttributesTopic]; !ok { return nil } + payloadAttrv2, ok := event.Data.(*ethpb.EventPayloadAttributeV2) + if ok { + return streamData(stream, PayloadAttributesTopic, payloadAttrv2) + } + + payloadAttr, ok := event.Data.(*ethpb.EventPayloadAttributeV1) + if ok { + return streamData(stream, PayloadAttributesTopic, payloadAttr) + } - return streamData(stream, PayloadAttributesTopic, nil) + return nil default: return nil } diff --git a/proto/eth/v1/BUILD.bazel b/proto/eth/v1/BUILD.bazel index ed2b5d419556..0ffed2e3f147 100644 --- a/proto/eth/v1/BUILD.bazel +++ b/proto/eth/v1/BUILD.bazel @@ -18,6 +18,7 @@ proto_library( visibility = ["//visibility:public"], deps = [ "//proto/eth/ext:proto", + "//proto/engine/v1:proto", "@com_google_protobuf//:descriptor_proto", "@com_google_protobuf//:timestamp_proto", ], @@ -36,6 +37,7 @@ ssz_gen_marshal( go_proto = ":go_proto", includes = [ "//consensus-types/primitives:go_default_library", + "//proto/engine/v1:go_default_library", ], objs = [ "AggregateAttestationAndProof", @@ -70,10 +72,12 @@ go_proto_library( visibility = ["//visibility:public"], deps = [ "//proto/eth/ext:go_default_library", + "//proto/engine/v1:go_default_library", "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", "@com_github_golang_protobuf//proto:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", # keep "//consensus-types/primitives:go_default_library", + "@io_bazel_rules_go//proto/wkt:timestamp_go_proto", "@org_golang_google_protobuf//types/known/timestamppb:go_default_library", ], ) diff --git a/proto/eth/v1/events.pb.go b/proto/eth/v1/events.pb.go index 3bfb6b7d5c7b..0e016d51061d 100755 --- a/proto/eth/v1/events.pb.go +++ b/proto/eth/v1/events.pb.go @@ -12,6 +12,7 @@ import ( _ "github.com/golang/protobuf/protoc-gen-go/descriptor" github_com_prysmaticlabs_prysm_v3_consensus_types_primitives "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives" + v1 "github.com/prysmaticlabs/prysm/v3/proto/engine/v1" _ "github.com/prysmaticlabs/prysm/v3/proto/eth/ext" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -403,6 +404,196 @@ func (x *EventFinalizedCheckpoint) GetExecutionOptimistic() bool { return false } +type EventPayloadAttributeV1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + ProposalSlot github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,2,opt,name=proposal_slot,json=proposalSlot,proto3" json:"proposal_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` + ParentBlockNumber github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=parent_block_number,json=parentBlockNumber,proto3" json:"parent_block_number,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` + ParentBlockRoot []byte `protobuf:"bytes,4,opt,name=parent_block_root,json=parentBlockRoot,proto3" json:"parent_block_root,omitempty" ssz-size:"32"` + ParentBlockHash []byte `protobuf:"bytes,5,opt,name=parent_block_hash,json=parentBlockHash,proto3" json:"parent_block_hash,omitempty" ssz-size:"32"` + ProposerIndex github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex `protobuf:"varint,6,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"` + PayloadAttributes *v1.PayloadAttributes `protobuf:"bytes,7,opt,name=payload_attributes,json=payloadAttributes,proto3" json:"payload_attributes,omitempty"` +} + +func (x *EventPayloadAttributeV1) Reset() { + *x = EventPayloadAttributeV1{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_v1_events_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventPayloadAttributeV1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventPayloadAttributeV1) ProtoMessage() {} + +func (x *EventPayloadAttributeV1) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_v1_events_proto_msgTypes[5] + 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 EventPayloadAttributeV1.ProtoReflect.Descriptor instead. +func (*EventPayloadAttributeV1) Descriptor() ([]byte, []int) { + return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{5} +} + +func (x *EventPayloadAttributeV1) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *EventPayloadAttributeV1) GetProposalSlot() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { + if x != nil { + return x.ProposalSlot + } + return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) +} + +func (x *EventPayloadAttributeV1) GetParentBlockNumber() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { + if x != nil { + return x.ParentBlockNumber + } + return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) +} + +func (x *EventPayloadAttributeV1) GetParentBlockRoot() []byte { + if x != nil { + return x.ParentBlockRoot + } + return nil +} + +func (x *EventPayloadAttributeV1) GetParentBlockHash() []byte { + if x != nil { + return x.ParentBlockHash + } + return nil +} + +func (x *EventPayloadAttributeV1) GetProposerIndex() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.ProposerIndex + } + return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *EventPayloadAttributeV1) GetPayloadAttributes() *v1.PayloadAttributes { + if x != nil { + return x.PayloadAttributes + } + return nil +} + +type EventPayloadAttributeV2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + ProposalSlot github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,2,opt,name=proposal_slot,json=proposalSlot,proto3" json:"proposal_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` + ParentBlockNumber github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=parent_block_number,json=parentBlockNumber,proto3" json:"parent_block_number,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` + ParentBlockRoot []byte `protobuf:"bytes,4,opt,name=parent_block_root,json=parentBlockRoot,proto3" json:"parent_block_root,omitempty" ssz-size:"32"` + ParentBlockHash []byte `protobuf:"bytes,5,opt,name=parent_block_hash,json=parentBlockHash,proto3" json:"parent_block_hash,omitempty" ssz-size:"32"` + ProposerIndex github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex `protobuf:"varint,6,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"` + PayloadAttributes *v1.PayloadAttributesV2 `protobuf:"bytes,7,opt,name=payload_attributes,json=payloadAttributes,proto3" json:"payload_attributes,omitempty"` +} + +func (x *EventPayloadAttributeV2) Reset() { + *x = EventPayloadAttributeV2{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_v1_events_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventPayloadAttributeV2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventPayloadAttributeV2) ProtoMessage() {} + +func (x *EventPayloadAttributeV2) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_v1_events_proto_msgTypes[6] + 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 EventPayloadAttributeV2.ProtoReflect.Descriptor instead. +func (*EventPayloadAttributeV2) Descriptor() ([]byte, []int) { + return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{6} +} + +func (x *EventPayloadAttributeV2) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *EventPayloadAttributeV2) GetProposalSlot() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { + if x != nil { + return x.ProposalSlot + } + return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) +} + +func (x *EventPayloadAttributeV2) GetParentBlockNumber() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { + if x != nil { + return x.ParentBlockNumber + } + return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) +} + +func (x *EventPayloadAttributeV2) GetParentBlockRoot() []byte { + if x != nil { + return x.ParentBlockRoot + } + return nil +} + +func (x *EventPayloadAttributeV2) GetParentBlockHash() []byte { + if x != nil { + return x.ParentBlockHash + } + return nil +} + +func (x *EventPayloadAttributeV2) GetProposerIndex() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.ProposerIndex + } + return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex(0) +} + +func (x *EventPayloadAttributeV2) GetPayloadAttributes() *v1.PayloadAttributesV2 { + if x != nil { + return x.PayloadAttributes + } + return nil +} + var File_proto_eth_v1_events_proto protoreflect.FileDescriptor var file_proto_eth_v1_events_proto_rawDesc = []byte{ @@ -412,99 +603,175 @@ var file_proto_eth_v1_events_proto_rawDesc = []byte{ 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2d, 0x0a, 0x13, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x22, 0x90, 0x03, 0x0a, 0x09, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x2d, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x6f, + 0x70, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x6f, 0x70, 0x69, + 0x63, 0x73, 0x22, 0x90, 0x03, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, + 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 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, 0x33, 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, 0x1c, 0x0a, 0x05, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x1c, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x64, + 0x75, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x19, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x44, 0x75, 0x74, 0x79, 0x44, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x45, 0x0a, 0x1b, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x75, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x70, 0x65, + 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x18, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x44, 0x75, 0x74, 0x79, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x6f, + 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, 0x07, 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, 0xb8, 0x01, 0x0a, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 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, 0x33, 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, + 0x1c, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, + 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 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, 0xcb, 0x03, 0x0a, 0x0f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, + 0x65, 0x6f, 0x72, 0x67, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 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, 0x33, 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, + 0x14, 0x0a, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, + 0x64, 0x65, 0x70, 0x74, 0x68, 0x12, 0x2c, 0x0a, 0x0e, 0x6f, 0x6c, 0x64, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, + 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x6f, 0x6c, 0x64, 0x48, 0x65, 0x61, 0x64, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x2c, 0x0a, 0x0e, 0x6e, 0x65, 0x77, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x5f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0c, 0x6e, 0x65, 0x77, 0x48, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x2c, 0x0a, 0x0e, 0x6f, 0x6c, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0c, 0x6f, 0x6c, 0x64, 0x48, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x2c, 0x0a, 0x0e, 0x6e, 0x65, 0x77, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x0c, 0x6e, 0x65, 0x77, 0x48, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x5c, 0x0a, + 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, 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, 0x33, 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, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 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, 0x08, 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, 0xe7, + 0x01, 0x0a, 0x18, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x05, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, + 0x33, 0x32, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x18, 0x03, 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, 0x33, 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, 0x1c, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x12, 0x1c, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x29, 0x0a, 0x10, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x1c, 0x70, 0x72, - 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x64, 0x75, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x70, 0x65, - 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x19, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, - 0x75, 0x73, 0x44, 0x75, 0x74, 0x79, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x45, 0x0a, 0x1b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x64, - 0x75, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x18, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x44, 0x75, 0x74, 0x79, 0x44, 0x65, 0x70, - 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x6f, 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, 0x07, 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, 0xb8, 0x01, - 0x0a, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x59, 0x0a, 0x04, - 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 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, - 0x33, 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, 0x1c, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 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, + 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x05, + 0x65, 0x70, 0x6f, 0x63, 0x68, 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, 0x04, 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, 0xcb, 0x03, 0x0a, 0x0f, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x6f, 0x72, 0x67, 0x12, 0x59, 0x0a, 0x04, - 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x01, 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, - 0x33, 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, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x12, 0x2c, 0x0a, - 0x0e, 0x6f, 0x6c, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x6f, - 0x6c, 0x64, 0x48, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2c, 0x0a, 0x0e, 0x6e, - 0x65, 0x77, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x6e, 0x65, 0x77, - 0x48, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2c, 0x0a, 0x0e, 0x6f, 0x6c, 0x64, - 0x5f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x6f, 0x6c, 0x64, 0x48, 0x65, - 0x61, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x0e, 0x6e, 0x65, 0x77, 0x5f, 0x68, - 0x65, 0x61, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c, 0x6e, 0x65, 0x77, 0x48, 0x65, 0x61, 0x64, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x22, 0xcc, 0x04, 0x0a, 0x17, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x56, 0x31, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x6a, + 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 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, 0x33, 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, 0x0c, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x75, 0x0a, 0x13, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x18, 0x03, 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, 0x33, 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, 0x11, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 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, 0x33, 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, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x54, 0x0a, 0x12, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x52, 0x11, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0xce, 0x04, 0x0a, 0x17, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x56, 0x32, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x6a, 0x0a, + 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 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, 0x33, 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, 0x52, 0x05, 0x65, 0x70, - 0x6f, 0x63, 0x68, 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, 0x08, 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, 0xe7, 0x01, 0x0a, 0x18, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x12, 0x1c, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x5c, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 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, 0x33, 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, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 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, 0x04, 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, - 0x42, 0x7e, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 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, 0x33, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x0f, 0x45, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, - 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0c, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x75, 0x0a, 0x13, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x03, 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, 0x33, 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, 0x11, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, + 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 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, 0x33, 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, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x56, 0x0a, 0x12, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x56, 0x32, 0x52, 0x11, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x42, 0x7e, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x42, + 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 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, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, + 0x68, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -519,20 +786,26 @@ func file_proto_eth_v1_events_proto_rawDescGZIP() []byte { return file_proto_eth_v1_events_proto_rawDescData } -var file_proto_eth_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_proto_eth_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_proto_eth_v1_events_proto_goTypes = []interface{}{ (*StreamEventsRequest)(nil), // 0: ethereum.eth.v1.StreamEventsRequest (*EventHead)(nil), // 1: ethereum.eth.v1.EventHead (*EventBlock)(nil), // 2: ethereum.eth.v1.EventBlock (*EventChainReorg)(nil), // 3: ethereum.eth.v1.EventChainReorg (*EventFinalizedCheckpoint)(nil), // 4: ethereum.eth.v1.EventFinalizedCheckpoint + (*EventPayloadAttributeV1)(nil), // 5: ethereum.eth.v1.EventPayloadAttributeV1 + (*EventPayloadAttributeV2)(nil), // 6: ethereum.eth.v1.EventPayloadAttributeV2 + (*v1.PayloadAttributes)(nil), // 7: ethereum.engine.v1.PayloadAttributes + (*v1.PayloadAttributesV2)(nil), // 8: ethereum.engine.v1.PayloadAttributesV2 } var file_proto_eth_v1_events_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 7, // 0: ethereum.eth.v1.EventPayloadAttributeV1.payload_attributes:type_name -> ethereum.engine.v1.PayloadAttributes + 8, // 1: ethereum.eth.v1.EventPayloadAttributeV2.payload_attributes:type_name -> ethereum.engine.v1.PayloadAttributesV2 + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_proto_eth_v1_events_proto_init() } @@ -601,6 +874,30 @@ func file_proto_eth_v1_events_proto_init() { return nil } } + file_proto_eth_v1_events_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventPayloadAttributeV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_v1_events_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventPayloadAttributeV2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -608,7 +905,7 @@ func file_proto_eth_v1_events_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_eth_v1_events_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/eth/v1/events.proto b/proto/eth/v1/events.proto index 7d4482d3e71a..3ef3c1453119 100644 --- a/proto/eth/v1/events.proto +++ b/proto/eth/v1/events.proto @@ -107,53 +107,53 @@ message EventFinalizedCheckpoint { } message EventPayloadAttributeV1 { - // the identifier of the beacon hard fork at `proposal_slot`, e.g.`"bellatrix"`. - string version = 1; + // the identifier of the beacon hard fork at `proposal_slot`, e.g.`"bellatrix"`. + string version = 1; - // The slot at which a block using these payload attributes may be built. - uint64 proposal_slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + // The slot at which a block using these payload attributes may be built. + uint64 proposal_slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; - // The execution block number of the parent block, which is also the Slot number. - uint64 parent_block_number = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + // The execution block number of the parent block, which is also the Slot number. + uint64 parent_block_number = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; - // The beacon block root of the parent block to be built upon. - bytes parent_block_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; + // The beacon block root of the parent block to be built upon. + bytes parent_block_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; - // The execution block hash of the parent block. - bytes parent_block_hash = 5 [(ethereum.eth.ext.ssz_size) = "32"]; + // The execution block hash of the parent block. + bytes parent_block_hash = 5 [(ethereum.eth.ext.ssz_size) = "32"]; - // The validator index of the proposer at proposal_slot on the chain identified by parent_block_root. - uint64 proposer_index = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"]; + // The validator index of the proposer at proposal_slot on the chain identified by parent_block_root. + uint64 proposer_index = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"]; - // payload_attributes: beacon API encoding of PayloadAttributesV as defined by the execution-apis specification. - // The version N must match the payload attributes for the hard fork matching version. - // The beacon API encoded object must have equivalent fields to its counterpart in execution-apis with two differences: - // 1) snake_case identifiers must be used rather than camelCase; 2) integers must be encoded as quoted decimals rather than big-endian hex. - PayloadAttributes payload_attributes = 7 + // payload_attributes: beacon API encoding of PayloadAttributesV as defined by the execution-apis specification. + // The version N must match the payload attributes for the hard fork matching version. + // The beacon API encoded object must have equivalent fields to its counterpart in execution-apis with two differences: + // 1) snake_case identifiers must be used rather than camelCase; 2) integers must be encoded as quoted decimals rather than big-endian hex. + engine.v1.PayloadAttributes payload_attributes = 7; } message EventPayloadAttributeV2 { - // the identifier of the beacon hard fork at `proposal_slot`, e.g. `"capella"`. - string version = 1; + // the identifier of the beacon hard fork at `proposal_slot`, e.g. `"capella"`. + string version = 1; - // The slot at which a block using these payload attributes may be built. - uint64 proposal_slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + // The slot at which a block using these payload attributes may be built. + uint64 proposal_slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; - // The execution block number of the parent block, which is also the Slot number. - uint64 parent_block_number = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + // The execution block number of the parent block, which is also the Slot number. + uint64 parent_block_number = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; - // The beacon block root of the parent block to be built upon. - bytes parent_block_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; + // The beacon block root of the parent block to be built upon. + bytes parent_block_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; - // The execution block hash of the parent block. - bytes parent_block_hash = 5 [(ethereum.eth.ext.ssz_size) = "32"]; + // The execution block hash of the parent block. + bytes parent_block_hash = 5 [(ethereum.eth.ext.ssz_size) = "32"]; - // The validator index of the proposer at proposal_slot on the chain identified by parent_block_root. - uint64 proposer_index = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"]; + // The validator index of the proposer at proposal_slot on the chain identified by parent_block_root. + uint64 proposer_index = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"]; - // payload_attributes: beacon API encoding of PayloadAttributesV as defined by the execution-apis specification. - // The version N must match the payload attributes for the hard fork matching version. - // The beacon API encoded object must have equivalent fields to its counterpart in execution-apis with two differences: - // 1) snake_case identifiers must be used rather than camelCase; 2) integers must be encoded as quoted decimals rather than big-endian hex. - PayloadAttributesV2 payload_attributes = 7 + // payload_attributes: beacon API encoding of PayloadAttributesV as defined by the execution-apis specification. + // The version N must match the payload attributes for the hard fork matching version. + // The beacon API encoded object must have equivalent fields to its counterpart in execution-apis with two differences: + // 1) snake_case identifiers must be used rather than camelCase; 2) integers must be encoded as quoted decimals rather than big-endian hex. + engine.v1.PayloadAttributesV2 payload_attributes = 7; } \ No newline at end of file From 78993b8b75ec8dd677784fe0885537f9bc590c06 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 10 Mar 2023 15:20:20 -0600 Subject: [PATCH 07/31] updating event payload proto type --- proto/eth/v1/events.proto | 48 +++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/proto/eth/v1/events.proto b/proto/eth/v1/events.proto index 3ef3c1453119..078a7e684517 100644 --- a/proto/eth/v1/events.proto +++ b/proto/eth/v1/events.proto @@ -106,31 +106,39 @@ message EventFinalizedCheckpoint { bool execution_optimistic = 4; } -message EventPayloadAttributeV1 { +message EventPayloadAttribute { // the identifier of the beacon hard fork at `proposal_slot`, e.g.`"bellatrix"`. string version = 1; + BasePayloadAttribute data = 2; + message BasePayloadAttribute { + // The slot at which a block using these payload attributes may be built. + uint64 proposal_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + + // The execution block number of the parent block, which is also the Slot number. + uint64 parent_block_number = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + + // The beacon block root of the parent block to be built upon. + bytes parent_block_root = 5 [(ethereum.eth.ext.ssz_size) = "32"]; + + // The execution block hash of the parent block. + bytes parent_block_hash = 6 [(ethereum.eth.ext.ssz_size) = "32"]; + + // The validator index of the proposer at proposal_slot on the chain identified by parent_block_root. + uint64 proposer_index = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"]; + + // payload_attributes: beacon API encoding of PayloadAttributesV as defined by the execution-apis specification. + // The version N must match the payload attributes for the hard fork matching version. + // The beacon API encoded object must have equivalent fields to its counterpart in execution-apis with two differences: + // 1) snake_case identifiers must be used rather than camelCase; 2) integers must be encoded as quoted decimals rather than big-endian hex. + oneof payload_attributes { + engine.v1.PayloadAttributes payload_attributes = 8; + engine.v1.PayloadAttributesV2 payload_attributes = 9; + } + } +} - // The slot at which a block using these payload attributes may be built. - uint64 proposal_slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; - - // The execution block number of the parent block, which is also the Slot number. - uint64 parent_block_number = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; - // The beacon block root of the parent block to be built upon. - bytes parent_block_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; - // The execution block hash of the parent block. - bytes parent_block_hash = 5 [(ethereum.eth.ext.ssz_size) = "32"]; - - // The validator index of the proposer at proposal_slot on the chain identified by parent_block_root. - uint64 proposer_index = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"]; - - // payload_attributes: beacon API encoding of PayloadAttributesV as defined by the execution-apis specification. - // The version N must match the payload attributes for the hard fork matching version. - // The beacon API encoded object must have equivalent fields to its counterpart in execution-apis with two differences: - // 1) snake_case identifiers must be used rather than camelCase; 2) integers must be encoded as quoted decimals rather than big-endian hex. - engine.v1.PayloadAttributes payload_attributes = 7; -} message EventPayloadAttributeV2 { // the identifier of the beacon hard fork at `proposal_slot`, e.g. `"capella"`. From 09c82cacd2102d1c17bc51e1b34704a564334be6 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 10 Mar 2023 15:31:54 -0600 Subject: [PATCH 08/31] updating events proto --- proto/eth/v1/events.pb.go | 339 +++++++++++++++++--------------------- proto/eth/v1/events.proto | 33 +--- 2 files changed, 157 insertions(+), 215 deletions(-) diff --git a/proto/eth/v1/events.pb.go b/proto/eth/v1/events.pb.go index 0e016d51061d..bad6011c90d4 100755 --- a/proto/eth/v1/events.pb.go +++ b/proto/eth/v1/events.pb.go @@ -404,22 +404,17 @@ func (x *EventFinalizedCheckpoint) GetExecutionOptimistic() bool { return false } -type EventPayloadAttributeV1 struct { +type EventPayloadAttribute struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - ProposalSlot github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,2,opt,name=proposal_slot,json=proposalSlot,proto3" json:"proposal_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` - ParentBlockNumber github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=parent_block_number,json=parentBlockNumber,proto3" json:"parent_block_number,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` - ParentBlockRoot []byte `protobuf:"bytes,4,opt,name=parent_block_root,json=parentBlockRoot,proto3" json:"parent_block_root,omitempty" ssz-size:"32"` - ParentBlockHash []byte `protobuf:"bytes,5,opt,name=parent_block_hash,json=parentBlockHash,proto3" json:"parent_block_hash,omitempty" ssz-size:"32"` - ProposerIndex github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex `protobuf:"varint,6,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"` - PayloadAttributes *v1.PayloadAttributes `protobuf:"bytes,7,opt,name=payload_attributes,json=payloadAttributes,proto3" json:"payload_attributes,omitempty"` + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Data *EventPayloadAttribute_BasePayloadAttribute `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` } -func (x *EventPayloadAttributeV1) Reset() { - *x = EventPayloadAttributeV1{} +func (x *EventPayloadAttribute) Reset() { + *x = EventPayloadAttribute{} if protoimpl.UnsafeEnabled { mi := &file_proto_eth_v1_events_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -427,13 +422,13 @@ func (x *EventPayloadAttributeV1) Reset() { } } -func (x *EventPayloadAttributeV1) String() string { +func (x *EventPayloadAttribute) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EventPayloadAttributeV1) ProtoMessage() {} +func (*EventPayloadAttribute) ProtoMessage() {} -func (x *EventPayloadAttributeV1) ProtoReflect() protoreflect.Message { +func (x *EventPayloadAttribute) ProtoReflect() protoreflect.Message { mi := &file_proto_eth_v1_events_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -445,76 +440,44 @@ func (x *EventPayloadAttributeV1) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use EventPayloadAttributeV1.ProtoReflect.Descriptor instead. -func (*EventPayloadAttributeV1) Descriptor() ([]byte, []int) { +// Deprecated: Use EventPayloadAttribute.ProtoReflect.Descriptor instead. +func (*EventPayloadAttribute) Descriptor() ([]byte, []int) { return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{5} } -func (x *EventPayloadAttributeV1) GetVersion() string { +func (x *EventPayloadAttribute) GetVersion() string { if x != nil { return x.Version } return "" } -func (x *EventPayloadAttributeV1) GetProposalSlot() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { +func (x *EventPayloadAttribute) GetData() *EventPayloadAttribute_BasePayloadAttribute { if x != nil { - return x.ProposalSlot - } - return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) -} - -func (x *EventPayloadAttributeV1) GetParentBlockNumber() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { - if x != nil { - return x.ParentBlockNumber - } - return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) -} - -func (x *EventPayloadAttributeV1) GetParentBlockRoot() []byte { - if x != nil { - return x.ParentBlockRoot - } - return nil -} - -func (x *EventPayloadAttributeV1) GetParentBlockHash() []byte { - if x != nil { - return x.ParentBlockHash - } - return nil -} - -func (x *EventPayloadAttributeV1) GetProposerIndex() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex { - if x != nil { - return x.ProposerIndex - } - return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex(0) -} - -func (x *EventPayloadAttributeV1) GetPayloadAttributes() *v1.PayloadAttributes { - if x != nil { - return x.PayloadAttributes + return x.Data } return nil } -type EventPayloadAttributeV2 struct { +type EventPayloadAttribute_BasePayloadAttribute struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - ProposalSlot github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,2,opt,name=proposal_slot,json=proposalSlot,proto3" json:"proposal_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` - ParentBlockNumber github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=parent_block_number,json=parentBlockNumber,proto3" json:"parent_block_number,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` - ParentBlockRoot []byte `protobuf:"bytes,4,opt,name=parent_block_root,json=parentBlockRoot,proto3" json:"parent_block_root,omitempty" ssz-size:"32"` - ParentBlockHash []byte `protobuf:"bytes,5,opt,name=parent_block_hash,json=parentBlockHash,proto3" json:"parent_block_hash,omitempty" ssz-size:"32"` - ProposerIndex github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex `protobuf:"varint,6,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"` - PayloadAttributes *v1.PayloadAttributesV2 `protobuf:"bytes,7,opt,name=payload_attributes,json=payloadAttributes,proto3" json:"payload_attributes,omitempty"` + ProposalSlot github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=proposal_slot,json=proposalSlot,proto3" json:"proposal_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` + ParentBlockNumber github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,4,opt,name=parent_block_number,json=parentBlockNumber,proto3" json:"parent_block_number,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` + ParentBlockRoot []byte `protobuf:"bytes,5,opt,name=parent_block_root,json=parentBlockRoot,proto3" json:"parent_block_root,omitempty" ssz-size:"32"` + ParentBlockHash []byte `protobuf:"bytes,6,opt,name=parent_block_hash,json=parentBlockHash,proto3" json:"parent_block_hash,omitempty" ssz-size:"32"` + ProposerIndex github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex `protobuf:"varint,7,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"` + // Types that are assignable to PayloadAttributes: + // + // *EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV1 + // *EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2 + PayloadAttributes isEventPayloadAttribute_BasePayloadAttribute_PayloadAttributes `protobuf_oneof:"payload_attributes"` } -func (x *EventPayloadAttributeV2) Reset() { - *x = EventPayloadAttributeV2{} +func (x *EventPayloadAttribute_BasePayloadAttribute) Reset() { + *x = EventPayloadAttribute_BasePayloadAttribute{} if protoimpl.UnsafeEnabled { mi := &file_proto_eth_v1_events_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -522,13 +485,13 @@ func (x *EventPayloadAttributeV2) Reset() { } } -func (x *EventPayloadAttributeV2) String() string { +func (x *EventPayloadAttribute_BasePayloadAttribute) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EventPayloadAttributeV2) ProtoMessage() {} +func (*EventPayloadAttribute_BasePayloadAttribute) ProtoMessage() {} -func (x *EventPayloadAttributeV2) ProtoReflect() protoreflect.Message { +func (x *EventPayloadAttribute_BasePayloadAttribute) ProtoReflect() protoreflect.Message { mi := &file_proto_eth_v1_events_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -540,60 +503,85 @@ func (x *EventPayloadAttributeV2) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use EventPayloadAttributeV2.ProtoReflect.Descriptor instead. -func (*EventPayloadAttributeV2) Descriptor() ([]byte, []int) { - return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{6} +// Deprecated: Use EventPayloadAttribute_BasePayloadAttribute.ProtoReflect.Descriptor instead. +func (*EventPayloadAttribute_BasePayloadAttribute) Descriptor() ([]byte, []int) { + return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{5, 0} } -func (x *EventPayloadAttributeV2) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *EventPayloadAttributeV2) GetProposalSlot() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { +func (x *EventPayloadAttribute_BasePayloadAttribute) GetProposalSlot() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { if x != nil { return x.ProposalSlot } return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) } -func (x *EventPayloadAttributeV2) GetParentBlockNumber() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { +func (x *EventPayloadAttribute_BasePayloadAttribute) GetParentBlockNumber() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { if x != nil { return x.ParentBlockNumber } return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) } -func (x *EventPayloadAttributeV2) GetParentBlockRoot() []byte { +func (x *EventPayloadAttribute_BasePayloadAttribute) GetParentBlockRoot() []byte { if x != nil { return x.ParentBlockRoot } return nil } -func (x *EventPayloadAttributeV2) GetParentBlockHash() []byte { +func (x *EventPayloadAttribute_BasePayloadAttribute) GetParentBlockHash() []byte { if x != nil { return x.ParentBlockHash } return nil } -func (x *EventPayloadAttributeV2) GetProposerIndex() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex { +func (x *EventPayloadAttribute_BasePayloadAttribute) GetProposerIndex() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex { if x != nil { return x.ProposerIndex } return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex(0) } -func (x *EventPayloadAttributeV2) GetPayloadAttributes() *v1.PayloadAttributesV2 { - if x != nil { - return x.PayloadAttributes +func (m *EventPayloadAttribute_BasePayloadAttribute) GetPayloadAttributes() isEventPayloadAttribute_BasePayloadAttribute_PayloadAttributes { + if m != nil { + return m.PayloadAttributes + } + return nil +} + +func (x *EventPayloadAttribute_BasePayloadAttribute) GetPayloadAttributesV1() *v1.PayloadAttributes { + if x, ok := x.GetPayloadAttributes().(*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV1); ok { + return x.PayloadAttributesV1 + } + return nil +} + +func (x *EventPayloadAttribute_BasePayloadAttribute) GetPayloadAttributesV2() *v1.PayloadAttributesV2 { + if x, ok := x.GetPayloadAttributes().(*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2); ok { + return x.PayloadAttributesV2 } return nil } +type isEventPayloadAttribute_BasePayloadAttribute_PayloadAttributes interface { + isEventPayloadAttribute_BasePayloadAttribute_PayloadAttributes() +} + +type EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV1 struct { + PayloadAttributesV1 *v1.PayloadAttributes `protobuf:"bytes,8,opt,name=payload_attributes_v1,json=payloadAttributesV1,proto3,oneof"` +} + +type EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2 struct { + PayloadAttributesV2 *v1.PayloadAttributesV2 `protobuf:"bytes,9,opt,name=payload_attributes_v2,json=payloadAttributesV2,proto3,oneof"` +} + +func (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV1) isEventPayloadAttribute_BasePayloadAttribute_PayloadAttributes() { +} + +func (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2) isEventPayloadAttribute_BasePayloadAttribute_PayloadAttributes() { +} + var File_proto_eth_v1_events_proto protoreflect.FileDescriptor var file_proto_eth_v1_events_proto_rawDesc = []byte{ @@ -689,89 +677,67 @@ var file_proto_eth_v1_events_proto_rawDesc = []byte{ 0x65, 0x70, 0x6f, 0x63, 0x68, 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, 0x04, 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, 0xcc, 0x04, 0x0a, 0x17, 0x45, 0x76, 0x65, + 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x22, 0xb0, 0x06, 0x0a, 0x15, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x56, 0x31, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x6a, - 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 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, 0x33, 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, 0x0c, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x75, 0x0a, 0x13, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x03, 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, 0x33, 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, 0x11, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 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, 0x33, 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, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x12, 0x54, 0x0a, 0x12, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x73, 0x52, 0x11, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0xce, 0x04, 0x0a, 0x17, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x56, 0x32, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x6a, 0x0a, - 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 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, 0x33, 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, 0x0c, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x75, 0x0a, 0x13, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x18, 0x03, 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, 0x33, 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, 0x11, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, - 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 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, 0x33, 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, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, - 0x12, 0x56, 0x0a, 0x12, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x73, 0x56, 0x32, 0x52, 0x11, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x42, 0x7e, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x42, - 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 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, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, - 0x68, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x4f, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xab, 0x05, + 0x0a, 0x14, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x6a, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 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, 0x33, 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, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x6c, + 0x6f, 0x74, 0x12, 0x75, 0x0a, 0x13, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 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, 0x33, 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, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x32, 0x0a, + 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, + 0x68, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x07, 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, 0x33, + 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, 0x0d, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x5b, 0x0a, 0x15, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, + 0x76, 0x31, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x48, + 0x00, 0x52, 0x13, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x56, 0x31, 0x12, 0x5d, 0x0a, 0x15, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x32, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, 0x48, 0x00, + 0x52, 0x13, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x56, 0x32, 0x42, 0x14, 0x0a, 0x12, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x42, 0x7e, 0x0a, 0x13, 0x6f, + 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x42, 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 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, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -788,24 +754,25 @@ func file_proto_eth_v1_events_proto_rawDescGZIP() []byte { var file_proto_eth_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_proto_eth_v1_events_proto_goTypes = []interface{}{ - (*StreamEventsRequest)(nil), // 0: ethereum.eth.v1.StreamEventsRequest - (*EventHead)(nil), // 1: ethereum.eth.v1.EventHead - (*EventBlock)(nil), // 2: ethereum.eth.v1.EventBlock - (*EventChainReorg)(nil), // 3: ethereum.eth.v1.EventChainReorg - (*EventFinalizedCheckpoint)(nil), // 4: ethereum.eth.v1.EventFinalizedCheckpoint - (*EventPayloadAttributeV1)(nil), // 5: ethereum.eth.v1.EventPayloadAttributeV1 - (*EventPayloadAttributeV2)(nil), // 6: ethereum.eth.v1.EventPayloadAttributeV2 - (*v1.PayloadAttributes)(nil), // 7: ethereum.engine.v1.PayloadAttributes - (*v1.PayloadAttributesV2)(nil), // 8: ethereum.engine.v1.PayloadAttributesV2 + (*StreamEventsRequest)(nil), // 0: ethereum.eth.v1.StreamEventsRequest + (*EventHead)(nil), // 1: ethereum.eth.v1.EventHead + (*EventBlock)(nil), // 2: ethereum.eth.v1.EventBlock + (*EventChainReorg)(nil), // 3: ethereum.eth.v1.EventChainReorg + (*EventFinalizedCheckpoint)(nil), // 4: ethereum.eth.v1.EventFinalizedCheckpoint + (*EventPayloadAttribute)(nil), // 5: ethereum.eth.v1.EventPayloadAttribute + (*EventPayloadAttribute_BasePayloadAttribute)(nil), // 6: ethereum.eth.v1.EventPayloadAttribute.BasePayloadAttribute + (*v1.PayloadAttributes)(nil), // 7: ethereum.engine.v1.PayloadAttributes + (*v1.PayloadAttributesV2)(nil), // 8: ethereum.engine.v1.PayloadAttributesV2 } var file_proto_eth_v1_events_proto_depIdxs = []int32{ - 7, // 0: ethereum.eth.v1.EventPayloadAttributeV1.payload_attributes:type_name -> ethereum.engine.v1.PayloadAttributes - 8, // 1: ethereum.eth.v1.EventPayloadAttributeV2.payload_attributes:type_name -> ethereum.engine.v1.PayloadAttributesV2 - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 6, // 0: ethereum.eth.v1.EventPayloadAttribute.data:type_name -> ethereum.eth.v1.EventPayloadAttribute.BasePayloadAttribute + 7, // 1: ethereum.eth.v1.EventPayloadAttribute.BasePayloadAttribute.payload_attributes_v1:type_name -> ethereum.engine.v1.PayloadAttributes + 8, // 2: ethereum.eth.v1.EventPayloadAttribute.BasePayloadAttribute.payload_attributes_v2:type_name -> ethereum.engine.v1.PayloadAttributesV2 + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_proto_eth_v1_events_proto_init() } @@ -875,7 +842,7 @@ func file_proto_eth_v1_events_proto_init() { } } file_proto_eth_v1_events_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EventPayloadAttributeV1); i { + switch v := v.(*EventPayloadAttribute); i { case 0: return &v.state case 1: @@ -887,7 +854,7 @@ func file_proto_eth_v1_events_proto_init() { } } file_proto_eth_v1_events_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EventPayloadAttributeV2); i { + switch v := v.(*EventPayloadAttribute_BasePayloadAttribute); i { case 0: return &v.state case 1: @@ -899,6 +866,10 @@ func file_proto_eth_v1_events_proto_init() { } } } + file_proto_eth_v1_events_proto_msgTypes[6].OneofWrappers = []interface{}{ + (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV1)(nil), + (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/proto/eth/v1/events.proto b/proto/eth/v1/events.proto index 078a7e684517..31d147c1d868 100644 --- a/proto/eth/v1/events.proto +++ b/proto/eth/v1/events.proto @@ -131,37 +131,8 @@ message EventPayloadAttribute { // The beacon API encoded object must have equivalent fields to its counterpart in execution-apis with two differences: // 1) snake_case identifiers must be used rather than camelCase; 2) integers must be encoded as quoted decimals rather than big-endian hex. oneof payload_attributes { - engine.v1.PayloadAttributes payload_attributes = 8; - engine.v1.PayloadAttributesV2 payload_attributes = 9; + engine.v1.PayloadAttributes payload_attributes_v1 = 8; + engine.v1.PayloadAttributesV2 payload_attributes_v2 = 9; } } -} - - - - -message EventPayloadAttributeV2 { - // the identifier of the beacon hard fork at `proposal_slot`, e.g. `"capella"`. - string version = 1; - - // The slot at which a block using these payload attributes may be built. - uint64 proposal_slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; - - // The execution block number of the parent block, which is also the Slot number. - uint64 parent_block_number = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; - - // The beacon block root of the parent block to be built upon. - bytes parent_block_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; - - // The execution block hash of the parent block. - bytes parent_block_hash = 5 [(ethereum.eth.ext.ssz_size) = "32"]; - - // The validator index of the proposer at proposal_slot on the chain identified by parent_block_root. - uint64 proposer_index = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"]; - - // payload_attributes: beacon API encoding of PayloadAttributesV as defined by the execution-apis specification. - // The version N must match the payload attributes for the hard fork matching version. - // The beacon API encoded object must have equivalent fields to its counterpart in execution-apis with two differences: - // 1) snake_case identifiers must be used rather than camelCase; 2) integers must be encoded as quoted decimals rather than big-endian hex. - engine.v1.PayloadAttributesV2 payload_attributes = 7; } \ No newline at end of file From e1db823284dcc5624774da8743ca7e7b73bee4a7 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 10 Mar 2023 15:47:23 -0600 Subject: [PATCH 09/31] fixing events type to oneof --- beacon-chain/rpc/apimiddleware/custom_handlers.go | 4 ++-- beacon-chain/rpc/apimiddleware/structs.go | 11 ++++++++++- beacon-chain/rpc/eth/events/events.go | 12 +++--------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/beacon-chain/rpc/apimiddleware/custom_handlers.go b/beacon-chain/rpc/apimiddleware/custom_handlers.go index 148ef122cd24..851b7b0d6385 100644 --- a/beacon-chain/rpc/apimiddleware/custom_handlers.go +++ b/beacon-chain/rpc/apimiddleware/custom_handlers.go @@ -431,9 +431,9 @@ func receiveEvents(eventChan <-chan *sse.Event, w http.ResponseWriter, req *http } switch dataSubset.Version { case version.String(version.Bellatrix): - data = &EventPayloadAttributeV1Json{} + data = &EventPayloadAttributeStreamV2Json{} case version.String(version.Capella): - data = &EventPayloadAttributeV2Json{} + data = &EventPayloadAttributeStreamV2Json{} default: return apimiddleware.InternalServerError(errors.New("payload version unsupported")) } diff --git a/beacon-chain/rpc/apimiddleware/structs.go b/beacon-chain/rpc/apimiddleware/structs.go index 45a1c038db93..c5f91581f2fa 100644 --- a/beacon-chain/rpc/apimiddleware/structs.go +++ b/beacon-chain/rpc/apimiddleware/structs.go @@ -1160,8 +1160,17 @@ type EventChainReorgJson struct { ExecutionOptimistic bool `json:"execution_optimistic"` } +type EventPayloadAttributeStreamV1Json struct { + Version string `json:"version"` + Data *EventPayloadAttributeV1Json +} + +type EventPayloadAttributeStreamV2Json struct { + Version string `json:"version"` + Data *EventPayloadAttributeV2Json +} + type EventPayloadAttributeBaseJson struct { - Version string `json:"version"` ProposerIndex string `json:"proposer_index"` ProposalSlot string `json:"proposal_slot"` ParentBlockNumber string `json:"parent_block_number"` diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index c070412f92af..50a63544d0b8 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -235,17 +235,11 @@ func handleStateEvents( if _, ok := requestedTopics[PayloadAttributesTopic]; !ok { return nil } - payloadAttrv2, ok := event.Data.(*ethpb.EventPayloadAttributeV2) + payloadAttr, ok := event.Data.(*ethpb.EventPayloadAttribute) if ok { - return streamData(stream, PayloadAttributesTopic, payloadAttrv2) - } - - payloadAttr, ok := event.Data.(*ethpb.EventPayloadAttributeV1) - if ok { - return streamData(stream, PayloadAttributesTopic, payloadAttr) + return nil } - - return nil + return streamData(stream, PayloadAttributesTopic, payloadAttr) default: return nil } From df8f7d43ceccb370f746642759107bc59a37f14e Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 10 Mar 2023 16:07:23 -0600 Subject: [PATCH 10/31] fixing broken payload --- beacon-chain/blockchain/execution_engine.go | 40 ++++++++++++--------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 503ad6b0476d..7a9b096efee7 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -182,14 +182,18 @@ func (s *Service) notifyPayloadAttributesStream(proposerIndex primitives.Validat } s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ Type: statefeed.PayloadAttributeSent, - Data: ðpbv1.EventPayloadAttributeV1{ - Version: version.String(attrs.Version()), - ProposerIndex: proposerIndex, - ProposalSlot: s.CurrentSlot() + 1, - ParentBlockNumber: parentBlockNumber, - ParentBlockRoot: parentBlockRoot, - ParentBlockHash: parentBlockHash, - PayloadAttributes: pbv1, + Data: ðpbv1.EventPayloadAttribute{ + Version: version.String(attrs.Version()), + Data: ðpbv1.EventPayloadAttribute_BasePayloadAttribute{ + ProposerIndex: proposerIndex, + ProposalSlot: s.CurrentSlot() + 1, + ParentBlockNumber: parentBlockNumber, + ParentBlockRoot: parentBlockRoot, + ParentBlockHash: parentBlockHash, + PayloadAttributes: ðpbv1.EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV1{ + PayloadAttributesV1: pbv1, + }, + }, }, }) return nil @@ -200,14 +204,18 @@ func (s *Service) notifyPayloadAttributesStream(proposerIndex primitives.Validat } s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ Type: statefeed.PayloadAttributeSent, - Data: ðpbv1.EventPayloadAttributeV2{ - Version: version.String(attrs.Version()), - ProposerIndex: proposerIndex, - ProposalSlot: s.CurrentSlot() + 1, - ParentBlockNumber: parentBlockNumber, - ParentBlockRoot: parentBlockRoot, - ParentBlockHash: parentBlockHash, - PayloadAttributes: pbv2, + Data: ðpbv1.EventPayloadAttribute{ + Version: version.String(attrs.Version()), + Data: ðpbv1.EventPayloadAttribute_BasePayloadAttribute{ + ProposerIndex: proposerIndex, + ProposalSlot: s.CurrentSlot() + 1, + ParentBlockNumber: parentBlockNumber, + ParentBlockRoot: parentBlockRoot, + ParentBlockHash: parentBlockHash, + PayloadAttributes: ðpbv1.EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2{ + PayloadAttributesV2: pbv2, + }, + }, }, }) return nil From a2e5e52b3f08aa64b4bcaef6f374a9b0cd38186d Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 10 Mar 2023 17:56:37 -0600 Subject: [PATCH 11/31] reverting back to using different event messages --- beacon-chain/blockchain/execution_engine.go | 16 ++-- .../rpc/apimiddleware/custom_handlers.go | 4 +- beacon-chain/rpc/apimiddleware/structs.go | 28 ++++--- beacon-chain/rpc/eth/events/events.go | 2 +- proto/eth/v1/events.pb.go | 84 +++++++++---------- proto/eth/v1/events.proto | 36 ++++++-- 6 files changed, 102 insertions(+), 68 deletions(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 7a9b096efee7..d48ab9b10de9 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -152,7 +152,9 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho log.WithError(err).Error("Could not set head root to valid") return nil, nil } - + if err := s.notifyPayloadAttributesStream(proposerId, arg.headBlock.Slot(), arg.headRoot[:], headPayload.BlockHash(), attr); err != nil { + return nil, err + } // If the forkchoice update call has an attribute, update the proposer payload ID cache. if hasAttr && payloadID != nil { var pId [8]byte @@ -190,8 +192,8 @@ func (s *Service) notifyPayloadAttributesStream(proposerIndex primitives.Validat ParentBlockNumber: parentBlockNumber, ParentBlockRoot: parentBlockRoot, ParentBlockHash: parentBlockHash, - PayloadAttributes: ðpbv1.EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV1{ - PayloadAttributesV1: pbv1, + VersionedPayloadAttributes: ðpbv1.EventPayloadAttribute_BasePayloadAttribute_PayloadAttributes{ + PayloadAttributes: pbv1, }, }, }, @@ -212,7 +214,7 @@ func (s *Service) notifyPayloadAttributesStream(proposerIndex primitives.Validat ParentBlockNumber: parentBlockNumber, ParentBlockRoot: parentBlockRoot, ParentBlockHash: parentBlockHash, - PayloadAttributes: ðpbv1.EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2{ + VersionedPayloadAttributes: ðpbv1.EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2{ PayloadAttributesV2: pbv2, }, }, @@ -318,7 +320,11 @@ func (s *Service) getPayloadAttribute(ctx context.Context, st state.BeaconState, // Root is `[32]byte{}` since we are retrieving proposer ID of a given slot. During insertion at assignment the root was not known. proposerID, _, ok := s.cfg.ProposerSlotIndexCache.GetProposerPayloadIDs(slot, [32]byte{} /* root */) if !ok { // There's no need to build attribute if there is no proposer for slot. - return false, emptyAttri, 0 + headBlock, err := s.HeadBlock(ctx) + if err != nil { + return false, emptyAttri, 0 + } + proposerID = headBlock.Block().ProposerIndex() } // Get previous randao. diff --git a/beacon-chain/rpc/apimiddleware/custom_handlers.go b/beacon-chain/rpc/apimiddleware/custom_handlers.go index 851b7b0d6385..f6f47466b390 100644 --- a/beacon-chain/rpc/apimiddleware/custom_handlers.go +++ b/beacon-chain/rpc/apimiddleware/custom_handlers.go @@ -430,10 +430,10 @@ func receiveEvents(eventChan <-chan *sse.Event, w http.ResponseWriter, req *http return apimiddleware.InternalServerError(err) } switch dataSubset.Version { - case version.String(version.Bellatrix): - data = &EventPayloadAttributeStreamV2Json{} case version.String(version.Capella): data = &EventPayloadAttributeStreamV2Json{} + case version.String(version.Bellatrix): + data = &EventPayloadAttributeStreamV1Json{} default: return apimiddleware.InternalServerError(errors.New("payload version unsupported")) } diff --git a/beacon-chain/rpc/apimiddleware/structs.go b/beacon-chain/rpc/apimiddleware/structs.go index c5f91581f2fa..07be83b6ccfb 100644 --- a/beacon-chain/rpc/apimiddleware/structs.go +++ b/beacon-chain/rpc/apimiddleware/structs.go @@ -1170,22 +1170,22 @@ type EventPayloadAttributeStreamV2Json struct { Data *EventPayloadAttributeV2Json } -type EventPayloadAttributeBaseJson struct { - ProposerIndex string `json:"proposer_index"` - ProposalSlot string `json:"proposal_slot"` - ParentBlockNumber string `json:"parent_block_number"` - ParentBlockRoot string `json:"parent_block_root" hex:"true"` - ParentBlockHash string `json:"parent_block_hash" hex:"true"` -} - type EventPayloadAttributeV1Json struct { - EventPayloadAttributeBaseJson + ProposerIndex string `json:"proposer_index"` + ProposalSlot string `json:"proposal_slot"` + ParentBlockNumber string `json:"parent_block_number"` + ParentBlockRoot string `json:"parent_block_root" hex:"true"` + ParentBlockHash string `json:"parent_block_hash" hex:"true"` PayloadAttributes *PayloadAttributesV1Json `json:"payload_attributes"` } type EventPayloadAttributeV2Json struct { - EventPayloadAttributeBaseJson - PayloadAttributes *PayloadAttributesV2Json `json:"payload_attributes"` + ProposerIndex string `json:"proposer_index"` + ProposalSlot string `json:"proposal_slot"` + ParentBlockNumber string `json:"parent_block_number"` + ParentBlockRoot string `json:"parent_block_root" hex:"true"` + ParentBlockHash string `json:"parent_block_hash" hex:"true"` + PayloadAttributes *PayloadAttributesV2Json `json:"payload_attributes_v2"` } type PayloadAttributesV1Json struct { @@ -1195,8 +1195,10 @@ type PayloadAttributesV1Json struct { } type PayloadAttributesV2Json struct { - PayloadAttributesV1Json - Withdrawals []*WithdrawalJson `json:"withdrawals"` + Timestamp string `json:"timestamp"` + Random string `json:"prev_randao" hex:"true"` + SuggestedFeeRecipient string `json:"suggested_fee_recipient" hex:"true"` + Withdrawals []*WithdrawalJson `json:"withdrawals"` } // --------------- diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 50a63544d0b8..780c3e979d98 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -236,7 +236,7 @@ func handleStateEvents( return nil } payloadAttr, ok := event.Data.(*ethpb.EventPayloadAttribute) - if ok { + if !ok { return nil } return streamData(stream, PayloadAttributesTopic, payloadAttr) diff --git a/proto/eth/v1/events.pb.go b/proto/eth/v1/events.pb.go index bad6011c90d4..3b2728914a9e 100755 --- a/proto/eth/v1/events.pb.go +++ b/proto/eth/v1/events.pb.go @@ -469,11 +469,11 @@ type EventPayloadAttribute_BasePayloadAttribute struct { ParentBlockRoot []byte `protobuf:"bytes,5,opt,name=parent_block_root,json=parentBlockRoot,proto3" json:"parent_block_root,omitempty" ssz-size:"32"` ParentBlockHash []byte `protobuf:"bytes,6,opt,name=parent_block_hash,json=parentBlockHash,proto3" json:"parent_block_hash,omitempty" ssz-size:"32"` ProposerIndex github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex `protobuf:"varint,7,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"` - // Types that are assignable to PayloadAttributes: + // Types that are assignable to VersionedPayloadAttributes: // - // *EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV1 + // *EventPayloadAttribute_BasePayloadAttribute_PayloadAttributes // *EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2 - PayloadAttributes isEventPayloadAttribute_BasePayloadAttribute_PayloadAttributes `protobuf_oneof:"payload_attributes"` + VersionedPayloadAttributes isEventPayloadAttribute_BasePayloadAttribute_VersionedPayloadAttributes `protobuf_oneof:"versioned_payload_attributes"` } func (x *EventPayloadAttribute_BasePayloadAttribute) Reset() { @@ -543,43 +543,43 @@ func (x *EventPayloadAttribute_BasePayloadAttribute) GetProposerIndex() github_c return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex(0) } -func (m *EventPayloadAttribute_BasePayloadAttribute) GetPayloadAttributes() isEventPayloadAttribute_BasePayloadAttribute_PayloadAttributes { +func (m *EventPayloadAttribute_BasePayloadAttribute) GetVersionedPayloadAttributes() isEventPayloadAttribute_BasePayloadAttribute_VersionedPayloadAttributes { if m != nil { - return m.PayloadAttributes + return m.VersionedPayloadAttributes } return nil } -func (x *EventPayloadAttribute_BasePayloadAttribute) GetPayloadAttributesV1() *v1.PayloadAttributes { - if x, ok := x.GetPayloadAttributes().(*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV1); ok { - return x.PayloadAttributesV1 +func (x *EventPayloadAttribute_BasePayloadAttribute) GetPayloadAttributes() *v1.PayloadAttributes { + if x, ok := x.GetVersionedPayloadAttributes().(*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributes); ok { + return x.PayloadAttributes } return nil } func (x *EventPayloadAttribute_BasePayloadAttribute) GetPayloadAttributesV2() *v1.PayloadAttributesV2 { - if x, ok := x.GetPayloadAttributes().(*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2); ok { + if x, ok := x.GetVersionedPayloadAttributes().(*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2); ok { return x.PayloadAttributesV2 } return nil } -type isEventPayloadAttribute_BasePayloadAttribute_PayloadAttributes interface { - isEventPayloadAttribute_BasePayloadAttribute_PayloadAttributes() +type isEventPayloadAttribute_BasePayloadAttribute_VersionedPayloadAttributes interface { + isEventPayloadAttribute_BasePayloadAttribute_VersionedPayloadAttributes() } -type EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV1 struct { - PayloadAttributesV1 *v1.PayloadAttributes `protobuf:"bytes,8,opt,name=payload_attributes_v1,json=payloadAttributesV1,proto3,oneof"` +type EventPayloadAttribute_BasePayloadAttribute_PayloadAttributes struct { + PayloadAttributes *v1.PayloadAttributes `protobuf:"bytes,8,opt,name=payload_attributes,proto3,oneof"` } type EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2 struct { - PayloadAttributesV2 *v1.PayloadAttributesV2 `protobuf:"bytes,9,opt,name=payload_attributes_v2,json=payloadAttributesV2,proto3,oneof"` + PayloadAttributesV2 *v1.PayloadAttributesV2 `protobuf:"bytes,9,opt,name=payload_attributes_v2,json=payload_attributes,proto3,oneof"` } -func (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV1) isEventPayloadAttribute_BasePayloadAttribute_PayloadAttributes() { +func (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributes) isEventPayloadAttribute_BasePayloadAttribute_VersionedPayloadAttributes() { } -func (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2) isEventPayloadAttribute_BasePayloadAttribute_PayloadAttributes() { +func (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2) isEventPayloadAttribute_BasePayloadAttribute_VersionedPayloadAttributes() { } var File_proto_eth_v1_events_proto protoreflect.FileDescriptor @@ -677,7 +677,7 @@ var file_proto_eth_v1_events_proto_rawDesc = []byte{ 0x65, 0x70, 0x6f, 0x63, 0x68, 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, 0x04, 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, 0xb0, 0x06, 0x0a, 0x15, 0x45, 0x76, 0x65, + 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x22, 0xb5, 0x06, 0x0a, 0x15, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x4f, 0x0a, 0x04, @@ -685,7 +685,7 @@ var file_proto_eth_v1_events_proto_rawDesc = []byte{ 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xab, 0x05, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xb0, 0x05, 0x0a, 0x14, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x6a, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, @@ -715,29 +715,29 @@ var file_proto_eth_v1_events_proto_rawDesc = []byte{ 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, 0x0d, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x5b, 0x0a, 0x15, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, - 0x76, 0x31, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, - 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x48, - 0x00, 0x52, 0x13, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x73, 0x56, 0x31, 0x12, 0x5d, 0x0a, 0x15, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x32, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x57, 0x0a, 0x12, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, 0x48, 0x00, - 0x52, 0x13, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x73, 0x56, 0x32, 0x42, 0x14, 0x0a, 0x12, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x42, 0x7e, 0x0a, 0x13, 0x6f, - 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, - 0x76, 0x31, 0x42, 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 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, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, - 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x48, 0x00, 0x52, 0x12, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x15, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x32, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, + 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, 0x48, 0x00, 0x52, 0x12, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x42, 0x1e, 0x0a, 0x1c, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x42, 0x7e, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 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, 0x33, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x0f, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -766,7 +766,7 @@ var file_proto_eth_v1_events_proto_goTypes = []interface{}{ } var file_proto_eth_v1_events_proto_depIdxs = []int32{ 6, // 0: ethereum.eth.v1.EventPayloadAttribute.data:type_name -> ethereum.eth.v1.EventPayloadAttribute.BasePayloadAttribute - 7, // 1: ethereum.eth.v1.EventPayloadAttribute.BasePayloadAttribute.payload_attributes_v1:type_name -> ethereum.engine.v1.PayloadAttributes + 7, // 1: ethereum.eth.v1.EventPayloadAttribute.BasePayloadAttribute.payload_attributes:type_name -> ethereum.engine.v1.PayloadAttributes 8, // 2: ethereum.eth.v1.EventPayloadAttribute.BasePayloadAttribute.payload_attributes_v2:type_name -> ethereum.engine.v1.PayloadAttributesV2 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type @@ -867,7 +867,7 @@ func file_proto_eth_v1_events_proto_init() { } } file_proto_eth_v1_events_proto_msgTypes[6].OneofWrappers = []interface{}{ - (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV1)(nil), + (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributes)(nil), (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2)(nil), } type x struct{} diff --git a/proto/eth/v1/events.proto b/proto/eth/v1/events.proto index 31d147c1d868..e2dc313ff2ce 100644 --- a/proto/eth/v1/events.proto +++ b/proto/eth/v1/events.proto @@ -106,7 +106,7 @@ message EventFinalizedCheckpoint { bool execution_optimistic = 4; } -message EventPayloadAttribute { +message EventPayloadAttributeV1 { // the identifier of the beacon hard fork at `proposal_slot`, e.g.`"bellatrix"`. string version = 1; BasePayloadAttribute data = 2; @@ -130,9 +130,35 @@ message EventPayloadAttribute { // The version N must match the payload attributes for the hard fork matching version. // The beacon API encoded object must have equivalent fields to its counterpart in execution-apis with two differences: // 1) snake_case identifiers must be used rather than camelCase; 2) integers must be encoded as quoted decimals rather than big-endian hex. - oneof payload_attributes { - engine.v1.PayloadAttributes payload_attributes_v1 = 8; - engine.v1.PayloadAttributesV2 payload_attributes_v2 = 9; - } + engine.v1.PayloadAttributes payload_attributes = 8; + } +} + + +message EventPayloadAttributeV2 { + // the identifier of the beacon hard fork at `proposal_slot`, e.g.`"bellatrix"`. + string version = 1; + BasePayloadAttribute data = 2; + message BasePayloadAttribute { + // The slot at which a block using these payload attributes may be built. + uint64 proposal_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + + // The execution block number of the parent block, which is also the Slot number. + uint64 parent_block_number = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + + // The beacon block root of the parent block to be built upon. + bytes parent_block_root = 5 [(ethereum.eth.ext.ssz_size) = "32"]; + + // The execution block hash of the parent block. + bytes parent_block_hash = 6 [(ethereum.eth.ext.ssz_size) = "32"]; + + // The validator index of the proposer at proposal_slot on the chain identified by parent_block_root. + uint64 proposer_index = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"]; + + // payload_attributes: beacon API encoding of PayloadAttributesV as defined by the execution-apis specification. + // The version N must match the payload attributes for the hard fork matching version. + // The beacon API encoded object must have equivalent fields to its counterpart in execution-apis with two differences: + // 1) snake_case identifiers must be used rather than camelCase; 2) integers must be encoded as quoted decimals rather than big-endian hex. + engine.v1.PayloadAttributesV2 payload_attributes_v2 = 8; } } \ No newline at end of file From 16fa737c34175369a24dbda67a026d958d66f11e Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 10 Mar 2023 18:09:40 -0600 Subject: [PATCH 12/31] updating event logic to handle different payload types --- beacon-chain/blockchain/execution_engine.go | 31 +- beacon-chain/rpc/eth/events/events.go | 12 +- proto/eth/v1/events.pb.go | 427 ++++++++++++++------ 3 files changed, 317 insertions(+), 153 deletions(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index d48ab9b10de9..4476420edb42 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -152,9 +152,7 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho log.WithError(err).Error("Could not set head root to valid") return nil, nil } - if err := s.notifyPayloadAttributesStream(proposerId, arg.headBlock.Slot(), arg.headRoot[:], headPayload.BlockHash(), attr); err != nil { - return nil, err - } + // If the forkchoice update call has an attribute, update the proposer payload ID cache. if hasAttr && payloadID != nil { var pId [8]byte @@ -184,17 +182,15 @@ func (s *Service) notifyPayloadAttributesStream(proposerIndex primitives.Validat } s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ Type: statefeed.PayloadAttributeSent, - Data: ðpbv1.EventPayloadAttribute{ + Data: ðpbv1.EventPayloadAttributeV1{ Version: version.String(attrs.Version()), - Data: ðpbv1.EventPayloadAttribute_BasePayloadAttribute{ + Data: ðpbv1.EventPayloadAttributeV1_BasePayloadAttribute{ ProposerIndex: proposerIndex, ProposalSlot: s.CurrentSlot() + 1, ParentBlockNumber: parentBlockNumber, ParentBlockRoot: parentBlockRoot, ParentBlockHash: parentBlockHash, - VersionedPayloadAttributes: ðpbv1.EventPayloadAttribute_BasePayloadAttribute_PayloadAttributes{ - PayloadAttributes: pbv1, - }, + PayloadAttributes: pbv1, }, }, }) @@ -206,17 +202,15 @@ func (s *Service) notifyPayloadAttributesStream(proposerIndex primitives.Validat } s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ Type: statefeed.PayloadAttributeSent, - Data: ðpbv1.EventPayloadAttribute{ + Data: ðpbv1.EventPayloadAttributeV2{ Version: version.String(attrs.Version()), - Data: ðpbv1.EventPayloadAttribute_BasePayloadAttribute{ - ProposerIndex: proposerIndex, - ProposalSlot: s.CurrentSlot() + 1, - ParentBlockNumber: parentBlockNumber, - ParentBlockRoot: parentBlockRoot, - ParentBlockHash: parentBlockHash, - VersionedPayloadAttributes: ðpbv1.EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2{ - PayloadAttributesV2: pbv2, - }, + Data: ðpbv1.EventPayloadAttributeV2_BasePayloadAttribute{ + ProposerIndex: proposerIndex, + ProposalSlot: s.CurrentSlot() + 1, + ParentBlockNumber: parentBlockNumber, + ParentBlockRoot: parentBlockRoot, + ParentBlockHash: parentBlockHash, + PayloadAttributesV2: pbv2, }, }, }) @@ -320,6 +314,7 @@ func (s *Service) getPayloadAttribute(ctx context.Context, st state.BeaconState, // Root is `[32]byte{}` since we are retrieving proposer ID of a given slot. During insertion at assignment the root was not known. proposerID, _, ok := s.cfg.ProposerSlotIndexCache.GetProposerPayloadIDs(slot, [32]byte{} /* root */) if !ok { // There's no need to build attribute if there is no proposer for slot. + // TODO: add in flag config to configure this... headBlock, err := s.HeadBlock(ctx) if err != nil { return false, emptyAttri, 0 diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 780c3e979d98..86f0be7ca55e 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -235,11 +235,15 @@ func handleStateEvents( if _, ok := requestedTopics[PayloadAttributesTopic]; !ok { return nil } - payloadAttr, ok := event.Data.(*ethpb.EventPayloadAttribute) - if !ok { - return nil + payloadAttrV2, ok := event.Data.(*ethpb.EventPayloadAttributeV2) + if ok { + return streamData(stream, PayloadAttributesTopic, payloadAttrV2) } - return streamData(stream, PayloadAttributesTopic, payloadAttr) + payloadAttrV1, ok := event.Data.(*ethpb.EventPayloadAttributeV1) + if ok { + return streamData(stream, PayloadAttributesTopic, payloadAttrV1) + } + return nil default: return nil } diff --git a/proto/eth/v1/events.pb.go b/proto/eth/v1/events.pb.go index 3b2728914a9e..cecfe570238a 100755 --- a/proto/eth/v1/events.pb.go +++ b/proto/eth/v1/events.pb.go @@ -404,17 +404,17 @@ func (x *EventFinalizedCheckpoint) GetExecutionOptimistic() bool { return false } -type EventPayloadAttribute struct { +type EventPayloadAttributeV1 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - Data *EventPayloadAttribute_BasePayloadAttribute `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Data *EventPayloadAttributeV1_BasePayloadAttribute `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` } -func (x *EventPayloadAttribute) Reset() { - *x = EventPayloadAttribute{} +func (x *EventPayloadAttributeV1) Reset() { + *x = EventPayloadAttributeV1{} if protoimpl.UnsafeEnabled { mi := &file_proto_eth_v1_events_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -422,13 +422,13 @@ func (x *EventPayloadAttribute) Reset() { } } -func (x *EventPayloadAttribute) String() string { +func (x *EventPayloadAttributeV1) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EventPayloadAttribute) ProtoMessage() {} +func (*EventPayloadAttributeV1) ProtoMessage() {} -func (x *EventPayloadAttribute) ProtoReflect() protoreflect.Message { +func (x *EventPayloadAttributeV1) ProtoReflect() protoreflect.Message { mi := &file_proto_eth_v1_events_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -440,26 +440,81 @@ func (x *EventPayloadAttribute) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use EventPayloadAttribute.ProtoReflect.Descriptor instead. -func (*EventPayloadAttribute) Descriptor() ([]byte, []int) { +// Deprecated: Use EventPayloadAttributeV1.ProtoReflect.Descriptor instead. +func (*EventPayloadAttributeV1) Descriptor() ([]byte, []int) { return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{5} } -func (x *EventPayloadAttribute) GetVersion() string { +func (x *EventPayloadAttributeV1) GetVersion() string { if x != nil { return x.Version } return "" } -func (x *EventPayloadAttribute) GetData() *EventPayloadAttribute_BasePayloadAttribute { +func (x *EventPayloadAttributeV1) GetData() *EventPayloadAttributeV1_BasePayloadAttribute { if x != nil { return x.Data } return nil } -type EventPayloadAttribute_BasePayloadAttribute struct { +type EventPayloadAttributeV2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Data *EventPayloadAttributeV2_BasePayloadAttribute `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *EventPayloadAttributeV2) Reset() { + *x = EventPayloadAttributeV2{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_v1_events_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventPayloadAttributeV2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventPayloadAttributeV2) ProtoMessage() {} + +func (x *EventPayloadAttributeV2) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_v1_events_proto_msgTypes[6] + 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 EventPayloadAttributeV2.ProtoReflect.Descriptor instead. +func (*EventPayloadAttributeV2) Descriptor() ([]byte, []int) { + return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{6} +} + +func (x *EventPayloadAttributeV2) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *EventPayloadAttributeV2) GetData() *EventPayloadAttributeV2_BasePayloadAttribute { + if x != nil { + return x.Data + } + return nil +} + +type EventPayloadAttributeV1_BasePayloadAttribute struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -469,30 +524,26 @@ type EventPayloadAttribute_BasePayloadAttribute struct { ParentBlockRoot []byte `protobuf:"bytes,5,opt,name=parent_block_root,json=parentBlockRoot,proto3" json:"parent_block_root,omitempty" ssz-size:"32"` ParentBlockHash []byte `protobuf:"bytes,6,opt,name=parent_block_hash,json=parentBlockHash,proto3" json:"parent_block_hash,omitempty" ssz-size:"32"` ProposerIndex github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex `protobuf:"varint,7,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"` - // Types that are assignable to VersionedPayloadAttributes: - // - // *EventPayloadAttribute_BasePayloadAttribute_PayloadAttributes - // *EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2 - VersionedPayloadAttributes isEventPayloadAttribute_BasePayloadAttribute_VersionedPayloadAttributes `protobuf_oneof:"versioned_payload_attributes"` + PayloadAttributes *v1.PayloadAttributes `protobuf:"bytes,8,opt,name=payload_attributes,json=payloadAttributes,proto3" json:"payload_attributes,omitempty"` } -func (x *EventPayloadAttribute_BasePayloadAttribute) Reset() { - *x = EventPayloadAttribute_BasePayloadAttribute{} +func (x *EventPayloadAttributeV1_BasePayloadAttribute) Reset() { + *x = EventPayloadAttributeV1_BasePayloadAttribute{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_v1_events_proto_msgTypes[6] + mi := &file_proto_eth_v1_events_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *EventPayloadAttribute_BasePayloadAttribute) String() string { +func (x *EventPayloadAttributeV1_BasePayloadAttribute) String() string { return protoimpl.X.MessageStringOf(x) } -func (*EventPayloadAttribute_BasePayloadAttribute) ProtoMessage() {} +func (*EventPayloadAttributeV1_BasePayloadAttribute) ProtoMessage() {} -func (x *EventPayloadAttribute_BasePayloadAttribute) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_v1_events_proto_msgTypes[6] +func (x *EventPayloadAttributeV1_BasePayloadAttribute) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_v1_events_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -503,83 +554,138 @@ func (x *EventPayloadAttribute_BasePayloadAttribute) ProtoReflect() protoreflect return mi.MessageOf(x) } -// Deprecated: Use EventPayloadAttribute_BasePayloadAttribute.ProtoReflect.Descriptor instead. -func (*EventPayloadAttribute_BasePayloadAttribute) Descriptor() ([]byte, []int) { +// Deprecated: Use EventPayloadAttributeV1_BasePayloadAttribute.ProtoReflect.Descriptor instead. +func (*EventPayloadAttributeV1_BasePayloadAttribute) Descriptor() ([]byte, []int) { return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{5, 0} } -func (x *EventPayloadAttribute_BasePayloadAttribute) GetProposalSlot() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { +func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetProposalSlot() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { if x != nil { return x.ProposalSlot } return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) } -func (x *EventPayloadAttribute_BasePayloadAttribute) GetParentBlockNumber() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { +func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetParentBlockNumber() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { if x != nil { return x.ParentBlockNumber } return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) } -func (x *EventPayloadAttribute_BasePayloadAttribute) GetParentBlockRoot() []byte { +func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetParentBlockRoot() []byte { if x != nil { return x.ParentBlockRoot } return nil } -func (x *EventPayloadAttribute_BasePayloadAttribute) GetParentBlockHash() []byte { +func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetParentBlockHash() []byte { if x != nil { return x.ParentBlockHash } return nil } -func (x *EventPayloadAttribute_BasePayloadAttribute) GetProposerIndex() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex { +func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetProposerIndex() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex { if x != nil { return x.ProposerIndex } return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex(0) } -func (m *EventPayloadAttribute_BasePayloadAttribute) GetVersionedPayloadAttributes() isEventPayloadAttribute_BasePayloadAttribute_VersionedPayloadAttributes { - if m != nil { - return m.VersionedPayloadAttributes +func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetPayloadAttributes() *v1.PayloadAttributes { + if x != nil { + return x.PayloadAttributes } return nil } -func (x *EventPayloadAttribute_BasePayloadAttribute) GetPayloadAttributes() *v1.PayloadAttributes { - if x, ok := x.GetVersionedPayloadAttributes().(*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributes); ok { - return x.PayloadAttributes +type EventPayloadAttributeV2_BasePayloadAttribute struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProposalSlot github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=proposal_slot,json=proposalSlot,proto3" json:"proposal_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` + ParentBlockNumber github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,4,opt,name=parent_block_number,json=parentBlockNumber,proto3" json:"parent_block_number,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` + ParentBlockRoot []byte `protobuf:"bytes,5,opt,name=parent_block_root,json=parentBlockRoot,proto3" json:"parent_block_root,omitempty" ssz-size:"32"` + ParentBlockHash []byte `protobuf:"bytes,6,opt,name=parent_block_hash,json=parentBlockHash,proto3" json:"parent_block_hash,omitempty" ssz-size:"32"` + ProposerIndex github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex `protobuf:"varint,7,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"` + PayloadAttributesV2 *v1.PayloadAttributesV2 `protobuf:"bytes,8,opt,name=payload_attributes_v2,json=payloadAttributesV2,proto3" json:"payload_attributes_v2,omitempty"` +} + +func (x *EventPayloadAttributeV2_BasePayloadAttribute) Reset() { + *x = EventPayloadAttributeV2_BasePayloadAttribute{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_v1_events_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -func (x *EventPayloadAttribute_BasePayloadAttribute) GetPayloadAttributesV2() *v1.PayloadAttributesV2 { - if x, ok := x.GetVersionedPayloadAttributes().(*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2); ok { - return x.PayloadAttributesV2 +func (x *EventPayloadAttributeV2_BasePayloadAttribute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventPayloadAttributeV2_BasePayloadAttribute) ProtoMessage() {} + +func (x *EventPayloadAttributeV2_BasePayloadAttribute) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_v1_events_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) +} + +// Deprecated: Use EventPayloadAttributeV2_BasePayloadAttribute.ProtoReflect.Descriptor instead. +func (*EventPayloadAttributeV2_BasePayloadAttribute) Descriptor() ([]byte, []int) { + return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{6, 0} } -type isEventPayloadAttribute_BasePayloadAttribute_VersionedPayloadAttributes interface { - isEventPayloadAttribute_BasePayloadAttribute_VersionedPayloadAttributes() +func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetProposalSlot() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { + if x != nil { + return x.ProposalSlot + } + return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) +} + +func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetParentBlockNumber() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { + if x != nil { + return x.ParentBlockNumber + } + return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) } -type EventPayloadAttribute_BasePayloadAttribute_PayloadAttributes struct { - PayloadAttributes *v1.PayloadAttributes `protobuf:"bytes,8,opt,name=payload_attributes,proto3,oneof"` +func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetParentBlockRoot() []byte { + if x != nil { + return x.ParentBlockRoot + } + return nil } -type EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2 struct { - PayloadAttributesV2 *v1.PayloadAttributesV2 `protobuf:"bytes,9,opt,name=payload_attributes_v2,json=payload_attributes,proto3,oneof"` +func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetParentBlockHash() []byte { + if x != nil { + return x.ParentBlockHash + } + return nil } -func (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributes) isEventPayloadAttribute_BasePayloadAttribute_VersionedPayloadAttributes() { +func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetProposerIndex() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex { + if x != nil { + return x.ProposerIndex + } + return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex(0) } -func (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2) isEventPayloadAttribute_BasePayloadAttribute_VersionedPayloadAttributes() { +func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetPayloadAttributesV2() *v1.PayloadAttributesV2 { + if x != nil { + return x.PayloadAttributesV2 + } + return nil } var File_proto_eth_v1_events_proto protoreflect.FileDescriptor @@ -677,67 +783,103 @@ var file_proto_eth_v1_events_proto_rawDesc = []byte{ 0x65, 0x70, 0x6f, 0x63, 0x68, 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, 0x04, 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, 0xb5, 0x06, 0x0a, 0x15, 0x45, 0x76, 0x65, + 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x22, 0xb8, 0x05, 0x0a, 0x17, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x4f, 0x0a, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xb0, 0x05, - 0x0a, 0x14, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x6a, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x61, 0x6c, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, - 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, + 0x74, 0x65, 0x56, 0x31, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x51, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x56, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x1a, 0xaf, 0x04, 0x0a, 0x14, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x6a, 0x0a, 0x0d, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 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, 0x33, 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, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x75, 0x0a, 0x13, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 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, 0x33, 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, 0x11, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x32, 0x0a, + 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, + 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, + 0x74, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, + 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x07, 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, 0x33, 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, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x6c, - 0x6f, 0x74, 0x12, 0x75, 0x0a, 0x13, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 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, 0x33, 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, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x32, 0x0a, - 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x07, 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, 0x33, - 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, 0x0d, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x57, 0x0a, 0x12, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x48, 0x00, 0x52, 0x12, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x12, 0x5c, 0x0a, 0x15, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x32, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, - 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, 0x48, 0x00, 0x52, 0x12, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, - 0x42, 0x1e, 0x0a, 0x1c, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, - 0x42, 0x7e, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x54, 0x0a, + 0x12, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x52, 0x11, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x22, 0xbf, 0x05, 0x0a, 0x17, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x32, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, + 0x32, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xb6, 0x04, 0x0a, + 0x14, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x6a, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 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, 0x33, 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, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x6c, 0x6f, + 0x74, 0x12, 0x75, 0x0a, 0x13, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 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, 0x33, 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, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x32, 0x0a, 0x11, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, + 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x07, 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, 0x33, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x0f, 0x45, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, - 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 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, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x5b, 0x0a, 0x15, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x76, + 0x32, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, + 0x52, 0x13, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x56, 0x32, 0x42, 0x7e, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x42, 0x65, + 0x61, 0x63, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x2e, 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, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, + 0x31, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, + 0x74, 0x68, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -752,27 +894,30 @@ func file_proto_eth_v1_events_proto_rawDescGZIP() []byte { return file_proto_eth_v1_events_proto_rawDescData } -var file_proto_eth_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_proto_eth_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_proto_eth_v1_events_proto_goTypes = []interface{}{ - (*StreamEventsRequest)(nil), // 0: ethereum.eth.v1.StreamEventsRequest - (*EventHead)(nil), // 1: ethereum.eth.v1.EventHead - (*EventBlock)(nil), // 2: ethereum.eth.v1.EventBlock - (*EventChainReorg)(nil), // 3: ethereum.eth.v1.EventChainReorg - (*EventFinalizedCheckpoint)(nil), // 4: ethereum.eth.v1.EventFinalizedCheckpoint - (*EventPayloadAttribute)(nil), // 5: ethereum.eth.v1.EventPayloadAttribute - (*EventPayloadAttribute_BasePayloadAttribute)(nil), // 6: ethereum.eth.v1.EventPayloadAttribute.BasePayloadAttribute - (*v1.PayloadAttributes)(nil), // 7: ethereum.engine.v1.PayloadAttributes - (*v1.PayloadAttributesV2)(nil), // 8: ethereum.engine.v1.PayloadAttributesV2 + (*StreamEventsRequest)(nil), // 0: ethereum.eth.v1.StreamEventsRequest + (*EventHead)(nil), // 1: ethereum.eth.v1.EventHead + (*EventBlock)(nil), // 2: ethereum.eth.v1.EventBlock + (*EventChainReorg)(nil), // 3: ethereum.eth.v1.EventChainReorg + (*EventFinalizedCheckpoint)(nil), // 4: ethereum.eth.v1.EventFinalizedCheckpoint + (*EventPayloadAttributeV1)(nil), // 5: ethereum.eth.v1.EventPayloadAttributeV1 + (*EventPayloadAttributeV2)(nil), // 6: ethereum.eth.v1.EventPayloadAttributeV2 + (*EventPayloadAttributeV1_BasePayloadAttribute)(nil), // 7: ethereum.eth.v1.EventPayloadAttributeV1.BasePayloadAttribute + (*EventPayloadAttributeV2_BasePayloadAttribute)(nil), // 8: ethereum.eth.v1.EventPayloadAttributeV2.BasePayloadAttribute + (*v1.PayloadAttributes)(nil), // 9: ethereum.engine.v1.PayloadAttributes + (*v1.PayloadAttributesV2)(nil), // 10: ethereum.engine.v1.PayloadAttributesV2 } var file_proto_eth_v1_events_proto_depIdxs = []int32{ - 6, // 0: ethereum.eth.v1.EventPayloadAttribute.data:type_name -> ethereum.eth.v1.EventPayloadAttribute.BasePayloadAttribute - 7, // 1: ethereum.eth.v1.EventPayloadAttribute.BasePayloadAttribute.payload_attributes:type_name -> ethereum.engine.v1.PayloadAttributes - 8, // 2: ethereum.eth.v1.EventPayloadAttribute.BasePayloadAttribute.payload_attributes_v2:type_name -> ethereum.engine.v1.PayloadAttributesV2 - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 7, // 0: ethereum.eth.v1.EventPayloadAttributeV1.data:type_name -> ethereum.eth.v1.EventPayloadAttributeV1.BasePayloadAttribute + 8, // 1: ethereum.eth.v1.EventPayloadAttributeV2.data:type_name -> ethereum.eth.v1.EventPayloadAttributeV2.BasePayloadAttribute + 9, // 2: ethereum.eth.v1.EventPayloadAttributeV1.BasePayloadAttribute.payload_attributes:type_name -> ethereum.engine.v1.PayloadAttributes + 10, // 3: ethereum.eth.v1.EventPayloadAttributeV2.BasePayloadAttribute.payload_attributes_v2:type_name -> ethereum.engine.v1.PayloadAttributesV2 + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_proto_eth_v1_events_proto_init() } @@ -842,7 +987,7 @@ func file_proto_eth_v1_events_proto_init() { } } file_proto_eth_v1_events_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EventPayloadAttribute); i { + switch v := v.(*EventPayloadAttributeV1); i { case 0: return &v.state case 1: @@ -854,7 +999,31 @@ func file_proto_eth_v1_events_proto_init() { } } file_proto_eth_v1_events_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EventPayloadAttribute_BasePayloadAttribute); i { + switch v := v.(*EventPayloadAttributeV2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_v1_events_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventPayloadAttributeV1_BasePayloadAttribute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_v1_events_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventPayloadAttributeV2_BasePayloadAttribute); i { case 0: return &v.state case 1: @@ -865,10 +1034,6 @@ func file_proto_eth_v1_events_proto_init() { return nil } } - } - file_proto_eth_v1_events_proto_msgTypes[6].OneofWrappers = []interface{}{ - (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributes)(nil), - (*EventPayloadAttribute_BasePayloadAttribute_PayloadAttributesV2)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -876,7 +1041,7 @@ func file_proto_eth_v1_events_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_eth_v1_events_proto_rawDesc, NumEnums: 0, - NumMessages: 7, + NumMessages: 9, NumExtensions: 0, NumServices: 0, }, From 16b0aa8674760fbc22f3aeb1effefeaec76a11c6 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Mon, 13 Mar 2023 15:15:18 -0500 Subject: [PATCH 13/31] wip edits --- cmd/beacon-chain/flags/base.go | 7 +++++++ cmd/beacon-chain/main.go | 1 + cmd/beacon-chain/usage.go | 1 + 3 files changed, 9 insertions(+) diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index 76d5154eaf09..7fa41b06fd6e 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -103,6 +103,7 @@ var ( Name: "disable-grpc-gateway", Usage: "Disable the gRPC gateway for JSON-HTTP requests", } + // GRPCGatewayHost specifies a gRPC gateway host for Prysm. GRPCGatewayHost = &cli.StringFlag{ Name: "grpc-gateway-host", @@ -253,4 +254,10 @@ var ( Usage: "Directory for the slasher database", Value: cmd.DefaultDataDir(), } + + // AlwaysPreparePayload for forcing payload attributes to be sent every fork choice update, used for builders and relays. + AlwaysPreparePayload = &cli.BoolFlag{ + Name: "always-prepare-payload", + Usage: "Forces payload attributes to be sent with every FCU regardless of connected proposers. This is intended for use by builders/relays.", + } ) diff --git a/cmd/beacon-chain/main.go b/cmd/beacon-chain/main.go index ab737190abfc..ff21dc9e1801 100644 --- a/cmd/beacon-chain/main.go +++ b/cmd/beacon-chain/main.go @@ -130,6 +130,7 @@ var appFlags = []cli.Flag{ genesis.StatePath, genesis.BeaconAPIURL, flags.SlasherDirFlag, + flags.AlwaysPreparePayload, } func init() { diff --git a/cmd/beacon-chain/usage.go b/cmd/beacon-chain/usage.go index 53d2928c581b..e4df820e345c 100644 --- a/cmd/beacon-chain/usage.go +++ b/cmd/beacon-chain/usage.go @@ -126,6 +126,7 @@ var appHelpFlagGroups = []flagGroup{ flags.MaxBuilderConsecutiveMissedSlots, flags.EngineEndpointTimeoutSeconds, flags.SlasherDirFlag, + flags.AlwaysPreparePayload, checkpoint.BlockPath, checkpoint.StatePath, checkpoint.RemoteURL, From 9150726b413f556d5fdd3cc5bbacfd14f2f5b6e5 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Mon, 13 Mar 2023 15:15:43 -0500 Subject: [PATCH 14/31] wip edits --- beacon-chain/blockchain/execution_engine.go | 15 +++--- .../blockchain/execution_engine_test.go | 50 ++++++++++++++++--- beacon-chain/blockchain/options.go | 8 +++ beacon-chain/blockchain/service.go | 1 + beacon-chain/node/config.go | 11 ++++ beacon-chain/node/node.go | 4 +- 6 files changed, 73 insertions(+), 16 deletions(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 4476420edb42..0767cdfc62c8 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -72,8 +72,8 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho } nextSlot := s.CurrentSlot() + 1 // Cache payload ID for next slot proposer. - hasAttr, attr, proposerId := s.getPayloadAttribute(ctx, arg.headState, nextSlot) - + hasAttr, attr, proposerId := s.getPayloadAttribute(ctx, arg.headBlock, arg.headState, nextSlot) + fmt.Printf("using headblock for proposer ID: %v", proposerId) payloadID, lastValidHash, err := s.cfg.ExecutionEngineCaller.ForkchoiceUpdated(ctx, fcs, attr) if err != nil { switch err { @@ -309,19 +309,18 @@ func (s *Service) notifyNewPayload(ctx context.Context, postStateVersion int, // getPayloadAttributes returns the payload attributes for the given state and slot. // The attribute is required to initiate a payload build process in the context of an `engine_forkchoiceUpdated` call. -func (s *Service) getPayloadAttribute(ctx context.Context, st state.BeaconState, slot primitives.Slot) (bool, payloadattribute.Attributer, primitives.ValidatorIndex) { +func (s *Service) getPayloadAttribute(ctx context.Context, blk interfaces.ReadOnlyBeaconBlock, st state.BeaconState, slot primitives.Slot) (bool, payloadattribute.Attributer, primitives.ValidatorIndex) { emptyAttri := payloadattribute.EmptyWithVersion(st.Version()) // Root is `[32]byte{}` since we are retrieving proposer ID of a given slot. During insertion at assignment the root was not known. proposerID, _, ok := s.cfg.ProposerSlotIndexCache.GetProposerPayloadIDs(slot, [32]byte{} /* root */) if !ok { // There's no need to build attribute if there is no proposer for slot. - // TODO: add in flag config to configure this... - headBlock, err := s.HeadBlock(ctx) - if err != nil { + if s.cfg.AlwaysPreparePayload { + proposerID = blk.ProposerIndex() + // fee recipient is not accurate in this case but shouldn't matter as builders should ignore it anyway. + } else { return false, emptyAttri, 0 } - proposerID = headBlock.Block().ProposerIndex() } - // Get previous randao. st = st.Copy() st, err := transition.ProcessSlotsIfPossible(ctx, st, slot) diff --git a/beacon-chain/blockchain/execution_engine_test.go b/beacon-chain/blockchain/execution_engine_test.go index 0981650d2e5c..777890dfb9c8 100644 --- a/beacon-chain/blockchain/execution_engine_test.go +++ b/beacon-chain/blockchain/execution_engine_test.go @@ -794,12 +794,17 @@ func Test_GetPayloadAttribute(t *testing.T) { WithStateGen(stategen.New(beaconDB, doublylinkedtree.New())), WithProposerIdsCache(cache.NewProposerPayloadIDsCache()), } - + b, err := consensusblocks.NewBeaconBlock(ðpb.BeaconBlockBellatrix{ + Body: ðpb.BeaconBlockBodyBellatrix{ + ExecutionPayload: &v1.ExecutionPayload{}, + }, + }) + require.NoError(t, err) // Cache miss service, err := NewService(ctx, opts...) require.NoError(t, err) st, _ := util.DeterministicGenesisStateBellatrix(t, 1) - hasPayload, _, vId := service.getPayloadAttribute(ctx, st, 0) + hasPayload, _, vId := service.getPayloadAttribute(ctx, b, st, 0) require.Equal(t, false, hasPayload) require.Equal(t, primitives.ValidatorIndex(0), vId) @@ -808,7 +813,7 @@ func Test_GetPayloadAttribute(t *testing.T) { slot := primitives.Slot(1) service.cfg.ProposerSlotIndexCache.SetProposerAndPayloadIDs(slot, suggestedVid, [8]byte{}, [32]byte{}) hook := logTest.NewGlobal() - hasPayload, attr, vId := service.getPayloadAttribute(ctx, st, slot) + hasPayload, attr, vId := service.getPayloadAttribute(ctx, b, st, slot) require.Equal(t, true, hasPayload) require.Equal(t, suggestedVid, vId) require.Equal(t, params.BeaconConfig().EthBurnAddressHex, common.BytesToAddress(attr.SuggestedFeeRecipient()).String()) @@ -818,7 +823,17 @@ func Test_GetPayloadAttribute(t *testing.T) { suggestedAddr := common.HexToAddress("123") require.NoError(t, service.cfg.BeaconDB.SaveFeeRecipientsByValidatorIDs(ctx, []primitives.ValidatorIndex{suggestedVid}, []common.Address{suggestedAddr})) service.cfg.ProposerSlotIndexCache.SetProposerAndPayloadIDs(slot, suggestedVid, [8]byte{}, [32]byte{}) - hasPayload, attr, vId = service.getPayloadAttribute(ctx, st, slot) + hasPayload, attr, vId = service.getPayloadAttribute(ctx, b, st, slot) + require.Equal(t, true, hasPayload) + require.Equal(t, suggestedVid, vId) + require.Equal(t, suggestedAddr, common.BytesToAddress(attr.SuggestedFeeRecipient())) + + // Override for non proposer + service.cfg.AlwaysPreparePayload = true + err = service.cfg.BeaconDB.SaveFeeRecipientsByValidatorIDs(ctx, []primitives.ValidatorIndex{b.ProposerIndex()}, []common.Address{suggestedAddr}) + require.NoError(t, err) + require.NoError(t, service.cfg.BeaconDB.SaveFeeRecipientsByValidatorIDs(ctx, []primitives.ValidatorIndex{suggestedVid}, []common.Address{suggestedAddr})) + hasPayload, attr, vId = service.getPayloadAttribute(ctx, b, st, slot) require.Equal(t, true, hasPayload) require.Equal(t, suggestedVid, vId) require.Equal(t, suggestedAddr, common.BytesToAddress(attr.SuggestedFeeRecipient())) @@ -832,12 +847,20 @@ func Test_GetPayloadAttributeV2(t *testing.T) { WithStateGen(stategen.New(beaconDB, doublylinkedtree.New())), WithProposerIdsCache(cache.NewProposerPayloadIDsCache()), } + b, err := consensusblocks.NewBeaconBlock(ðpb.BeaconBlockCapella{ + Slot: 1, + ProposerIndex: 1, + Body: ðpb.BeaconBlockBodyCapella{ + ExecutionPayload: &v1.ExecutionPayloadCapella{}, + }, + }) + require.NoError(t, err) // Cache miss service, err := NewService(ctx, opts...) require.NoError(t, err) st, _ := util.DeterministicGenesisStateCapella(t, 1) - hasPayload, _, vId := service.getPayloadAttribute(ctx, st, 0) + hasPayload, _, vId := service.getPayloadAttribute(ctx, b, st, 0) require.Equal(t, false, hasPayload) require.Equal(t, primitives.ValidatorIndex(0), vId) @@ -846,7 +869,7 @@ func Test_GetPayloadAttributeV2(t *testing.T) { slot := primitives.Slot(1) service.cfg.ProposerSlotIndexCache.SetProposerAndPayloadIDs(slot, suggestedVid, [8]byte{}, [32]byte{}) hook := logTest.NewGlobal() - hasPayload, attr, vId := service.getPayloadAttribute(ctx, st, slot) + hasPayload, attr, vId := service.getPayloadAttribute(ctx, b, st, slot) require.Equal(t, true, hasPayload) require.Equal(t, suggestedVid, vId) require.Equal(t, params.BeaconConfig().EthBurnAddressHex, common.BytesToAddress(attr.SuggestedFeeRecipient()).String()) @@ -859,7 +882,20 @@ func Test_GetPayloadAttributeV2(t *testing.T) { suggestedAddr := common.HexToAddress("123") require.NoError(t, service.cfg.BeaconDB.SaveFeeRecipientsByValidatorIDs(ctx, []primitives.ValidatorIndex{suggestedVid}, []common.Address{suggestedAddr})) service.cfg.ProposerSlotIndexCache.SetProposerAndPayloadIDs(slot, suggestedVid, [8]byte{}, [32]byte{}) - hasPayload, attr, vId = service.getPayloadAttribute(ctx, st, slot) + hasPayload, attr, vId = service.getPayloadAttribute(ctx, b, st, slot) + require.Equal(t, true, hasPayload) + require.Equal(t, suggestedVid, vId) + require.Equal(t, suggestedAddr, common.BytesToAddress(attr.SuggestedFeeRecipient())) + a, err = attr.Withdrawals() + require.NoError(t, err) + require.Equal(t, 0, len(a)) + + // Override for non proposer + service.cfg.AlwaysPreparePayload = true + err = service.cfg.BeaconDB.SaveFeeRecipientsByValidatorIDs(ctx, []primitives.ValidatorIndex{b.ProposerIndex()}, []common.Address{suggestedAddr}) + require.NoError(t, err) + require.NoError(t, service.cfg.BeaconDB.SaveFeeRecipientsByValidatorIDs(ctx, []primitives.ValidatorIndex{suggestedVid}, []common.Address{suggestedAddr})) + hasPayload, attr, vId = service.getPayloadAttribute(ctx, b, st, slot) require.Equal(t, true, hasPayload) require.Equal(t, suggestedVid, vId) require.Equal(t, suggestedAddr, common.BytesToAddress(attr.SuggestedFeeRecipient())) diff --git a/beacon-chain/blockchain/options.go b/beacon-chain/blockchain/options.go index f89efda960eb..104b72969410 100644 --- a/beacon-chain/blockchain/options.go +++ b/beacon-chain/blockchain/options.go @@ -163,3 +163,11 @@ func WithFinalizedStateAtStartUp(st state.BeaconState) Option { return nil } } + +// WithAlwaysPreparePayload sets payload attributes to submit on slots +func WithAlwaysPreparePayload(is bool) Option { + return func(s *Service) error { + s.cfg.AlwaysPreparePayload = is + return nil + } +} diff --git a/beacon-chain/blockchain/service.go b/beacon-chain/blockchain/service.go index 2d1441bb9eda..c1965e39f13e 100644 --- a/beacon-chain/blockchain/service.go +++ b/beacon-chain/blockchain/service.go @@ -81,6 +81,7 @@ type config struct { BlockFetcher execution.POWBlockFetcher FinalizedStateAtStartUp state.BeaconState ExecutionEngineCaller execution.EngineCaller + AlwaysPreparePayload bool } // NewService instantiates a new block service instance that will diff --git a/beacon-chain/node/config.go b/beacon-chain/node/config.go index 0bdb22184ead..0e130d6d2317 100644 --- a/beacon-chain/node/config.go +++ b/beacon-chain/node/config.go @@ -71,6 +71,17 @@ func configureBuilderCircuitBreaker(cliCtx *cli.Context) error { return nil } +func configureAlwaysPreparePayload(cliCtx *cli.Context) error { + if cliCtx.Bool(flags.AlwaysPreparePayload.Name) { + c := params.BeaconConfig().Copy() + c.MaxBuilderConsecutiveMissedSlots = primitives.Slot(cliCtx.Int(flags.MaxBuilderConsecutiveMissedSlots.Name)) + if err := params.SetActive(c); err != nil { + return err + } + } + return nil +} + func configureSlotsPerArchivedPoint(cliCtx *cli.Context) error { if cliCtx.IsSet(flags.SlotsPerArchivedPoint.Name) { c := params.BeaconConfig().Copy() diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index a4d0d9584eba..965f9d53f9cd 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -609,7 +609,9 @@ func (b *BeaconNode) registerBlockchainService(fc forkchoice.ForkChoicer) error blockchain.WithFinalizedStateAtStartUp(b.finalizedStateAtStartUp), blockchain.WithProposerIdsCache(b.proposerIdsCache), ) - + if b.cliCtx.Bool(flags.AlwaysPreparePayload.Name) { + opts = append(opts, blockchain.WithAlwaysPreparePayload(b.cliCtx.Bool(flags.AlwaysPreparePayload.Name))) + } blockchainService, err := blockchain.NewService(b.ctx, opts...) if err != nil { return errors.Wrap(err, "could not register blockchain service") From 1879d6893fd127023cf0ffd1c42620782f54b6e7 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Mon, 13 Mar 2023 15:28:54 -0500 Subject: [PATCH 15/31] removing unused function --- beacon-chain/node/config.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/beacon-chain/node/config.go b/beacon-chain/node/config.go index 0e130d6d2317..0bdb22184ead 100644 --- a/beacon-chain/node/config.go +++ b/beacon-chain/node/config.go @@ -71,17 +71,6 @@ func configureBuilderCircuitBreaker(cliCtx *cli.Context) error { return nil } -func configureAlwaysPreparePayload(cliCtx *cli.Context) error { - if cliCtx.Bool(flags.AlwaysPreparePayload.Name) { - c := params.BeaconConfig().Copy() - c.MaxBuilderConsecutiveMissedSlots = primitives.Slot(cliCtx.Int(flags.MaxBuilderConsecutiveMissedSlots.Name)) - if err := params.SetActive(c); err != nil { - return err - } - } - return nil -} - func configureSlotsPerArchivedPoint(cliCtx *cli.Context) error { if cliCtx.IsSet(flags.SlotsPerArchivedPoint.Name) { c := params.BeaconConfig().Copy() From 58fd78374c04e89eb88200ae170aed83fb959950 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Mon, 13 Mar 2023 20:27:58 -0500 Subject: [PATCH 16/31] adding terence's suggestions --- beacon-chain/blockchain/execution_engine.go | 64 +---------- beacon-chain/node/node.go | 3 - beacon-chain/rpc/eth/events/events.go | 116 ++++++++++++++++---- beacon-chain/rpc/eth/events/server.go | 2 + beacon-chain/rpc/service.go | 1 + cmd/beacon-chain/flags/base.go | 6 - cmd/beacon-chain/main.go | 1 - cmd/beacon-chain/usage.go | 1 - 8 files changed, 101 insertions(+), 93 deletions(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 0767cdfc62c8..79e9474482b9 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -6,8 +6,6 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/blocks" - "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed" - statefeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/state" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/transition" @@ -21,7 +19,6 @@ import ( "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v3/encoding/bytesutil" enginev1 "github.com/prysmaticlabs/prysm/v3/proto/engine/v1" - ethpbv1 "github.com/prysmaticlabs/prysm/v3/proto/eth/v1" "github.com/prysmaticlabs/prysm/v3/runtime/version" "github.com/prysmaticlabs/prysm/v3/time/slots" "github.com/sirupsen/logrus" @@ -158,10 +155,6 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho var pId [8]byte copy(pId[:], payloadID[:]) s.cfg.ProposerSlotIndexCache.SetProposerAndPayloadIDs(nextSlot, proposerId, pId, arg.headRoot) - // On successful FCU notify that the payload was sent to the event stream. - if err := s.notifyPayloadAttributesStream(proposerId, arg.headBlock.Slot(), arg.headRoot[:], headPayload.BlockHash(), attr); err != nil { - return nil, err - } } else if hasAttr && payloadID == nil { log.WithFields(logrus.Fields{ "blockHash": fmt.Sprintf("%#x", headPayload.BlockHash()), @@ -171,55 +164,6 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho return payloadID, nil } -// notifyPayloadAttributesStream on successful FCU notify the event stream that a payload was sent -func (s *Service) notifyPayloadAttributesStream(proposerIndex primitives.ValidatorIndex, - parentBlockNumber primitives.Slot, parentBlockRoot []byte, parentBlockHash []byte, attrs payloadattribute.Attributer) error { - switch attrs.Version() { - case version.Bellatrix: - pbv1, err := attrs.PbV1() - if err != nil { - return err - } - s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ - Type: statefeed.PayloadAttributeSent, - Data: ðpbv1.EventPayloadAttributeV1{ - Version: version.String(attrs.Version()), - Data: ðpbv1.EventPayloadAttributeV1_BasePayloadAttribute{ - ProposerIndex: proposerIndex, - ProposalSlot: s.CurrentSlot() + 1, - ParentBlockNumber: parentBlockNumber, - ParentBlockRoot: parentBlockRoot, - ParentBlockHash: parentBlockHash, - PayloadAttributes: pbv1, - }, - }, - }) - return nil - case version.Capella: - pbv2, err := attrs.PbV2() - if err != nil { - return err - } - s.cfg.StateNotifier.StateFeed().Send(&feed.Event{ - Type: statefeed.PayloadAttributeSent, - Data: ðpbv1.EventPayloadAttributeV2{ - Version: version.String(attrs.Version()), - Data: ðpbv1.EventPayloadAttributeV2_BasePayloadAttribute{ - ProposerIndex: proposerIndex, - ProposalSlot: s.CurrentSlot() + 1, - ParentBlockNumber: parentBlockNumber, - ParentBlockRoot: parentBlockRoot, - ParentBlockHash: parentBlockHash, - PayloadAttributesV2: pbv2, - }, - }, - }) - return nil - default: - return errors.New("payload version is not supported") - } -} - // getPayloadHash returns the payload hash given the block root. // if the block is before bellatrix fork epoch, it returns the zero hash. func (s *Service) getPayloadHash(ctx context.Context, root []byte) ([32]byte, error) { @@ -314,12 +258,8 @@ func (s *Service) getPayloadAttribute(ctx context.Context, blk interfaces.ReadOn // Root is `[32]byte{}` since we are retrieving proposer ID of a given slot. During insertion at assignment the root was not known. proposerID, _, ok := s.cfg.ProposerSlotIndexCache.GetProposerPayloadIDs(slot, [32]byte{} /* root */) if !ok { // There's no need to build attribute if there is no proposer for slot. - if s.cfg.AlwaysPreparePayload { - proposerID = blk.ProposerIndex() - // fee recipient is not accurate in this case but shouldn't matter as builders should ignore it anyway. - } else { - return false, emptyAttri, 0 - } + + return false, emptyAttri, 0 } // Get previous randao. st = st.Copy() diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index 965f9d53f9cd..4ed1941e2139 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -609,9 +609,6 @@ func (b *BeaconNode) registerBlockchainService(fc forkchoice.ForkChoicer) error blockchain.WithFinalizedStateAtStartUp(b.finalizedStateAtStartUp), blockchain.WithProposerIdsCache(b.proposerIdsCache), ) - if b.cliCtx.Bool(flags.AlwaysPreparePayload.Name) { - opts = append(opts, blockchain.WithAlwaysPreparePayload(b.cliCtx.Bool(flags.AlwaysPreparePayload.Name))) - } blockchainService, err := blockchain.NewService(b.ctx, opts...) if err != nil { return errors.Wrap(err, "could not register blockchain service") diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 86f0be7ca55e..6e0939ed7eb5 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -9,9 +9,15 @@ import ( blockfeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/block" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/operation" statefeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/state" + "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/helpers" + "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/time" + "github.com/prysmaticlabs/prysm/v3/proto/engine/v1" ethpbservice "github.com/prysmaticlabs/prysm/v3/proto/eth/service" ethpb "github.com/prysmaticlabs/prysm/v3/proto/eth/v1" "github.com/prysmaticlabs/prysm/v3/proto/migration" + "github.com/prysmaticlabs/prysm/v3/runtime/version" + "github.com/prysmaticlabs/prysm/v3/time/slots" + log "github.com/sirupsen/logrus" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" @@ -98,7 +104,7 @@ func (s *Server) StreamEvents( return status.Errorf(codes.Internal, "Could not handle block operations event: %v", err) } case event := <-stateChan: - if err := handleStateEvents(stream, requestedTopics, event); err != nil { + if err := s.handleStateEvents(stream, requestedTopics, event); err != nil { return status.Errorf(codes.Internal, "Could not handle state event: %v", err) } case <-s.Ctx.Done(): @@ -200,19 +206,25 @@ func handleBlockOperationEvents( } } -func handleStateEvents( +func (s *Server) handleStateEvents( stream ethpbservice.Events_StreamEventsServer, requestedTopics map[string]bool, event *feed.Event, ) error { switch event.Type { case statefeed.NewHead: - if _, ok := requestedTopics[HeadTopic]; !ok { - return nil + if _, ok := requestedTopics[HeadTopic]; ok { + head, ok := event.Data.(*ethpb.EventHead) + if !ok { + return nil + } + return streamData(stream, HeadTopic, head) } - head, ok := event.Data.(*ethpb.EventHead) - if !ok { + if _, ok := requestedTopics[PayloadAttributesTopic]; ok { + if err := s.streamPayloadAttributes(stream); err != nil { + log.Error("Unable to obtain stream payload attributes: %v", err) + } return nil } - return streamData(stream, HeadTopic, head) + return nil case statefeed.FinalizedCheckpoint: if _, ok := requestedTopics[FinalizedCheckpointTopic]; !ok { return nil @@ -231,24 +243,88 @@ func handleStateEvents( return nil } return streamData(stream, ChainReorgTopic, reorg) - case statefeed.PayloadAttributeSent: - if _, ok := requestedTopics[PayloadAttributesTopic]; !ok { - return nil - } - payloadAttrV2, ok := event.Data.(*ethpb.EventPayloadAttributeV2) - if ok { - return streamData(stream, PayloadAttributesTopic, payloadAttrV2) - } - payloadAttrV1, ok := event.Data.(*ethpb.EventPayloadAttributeV1) - if ok { - return streamData(stream, PayloadAttributesTopic, payloadAttrV1) - } - return nil default: return nil } } +// notifyPayloadAttributesStream on successful FCU notify the event stream that a payload was sent +func (s *Server) streamPayloadAttributes(stream ethpbservice.Events_StreamEventsServer) error { + headState, err := s.HeadFetcher.HeadStateReadOnly(s.Ctx) + if err != nil { + return err + } + + headBlock, err := s.HeadFetcher.HeadBlock(s.Ctx) + if err != nil { + return err + } + + headRoot, err := s.HeadFetcher.HeadRoot(s.Ctx) + if err != nil { + + return err + } + + headPayload, err := headBlock.Block().Body().Execution() + if err != nil { + + return err + } + + t, err := slots.ToTime(uint64(headState.GenesisTime()), headState.Slot()) + if err != nil { + return err + } + + prevRando, err := helpers.RandaoMix(headState, time.CurrentEpoch(headState)) + if err != nil { + return err + } + + switch headState.Version() { + case version.Bellatrix: + return streamData(stream, PayloadAttributesTopic, ðpb.EventPayloadAttributeV1{ + Version: version.String(headState.Version()), + Data: ðpb.EventPayloadAttributeV1_BasePayloadAttribute{ + ProposerIndex: headBlock.Block().ProposerIndex(), + ProposalSlot: headState.Slot(), + ParentBlockNumber: headBlock.Block().Slot(), + ParentBlockRoot: headRoot, + ParentBlockHash: headPayload.BlockHash(), + PayloadAttributes: &enginev1.PayloadAttributes{ + Timestamp: uint64(t.Unix()), + PrevRandao: prevRando, + SuggestedFeeRecipient: headPayload.FeeRecipient(), + }, + }, + }) + case version.Capella: + withdrawals, err := headState.ExpectedWithdrawals() + if err != nil { + return err + } + return streamData(stream, PayloadAttributesTopic, ðpb.EventPayloadAttributeV2{ + Version: version.String(headState.Version()), + Data: ðpb.EventPayloadAttributeV2_BasePayloadAttribute{ + ProposerIndex: headBlock.Block().ProposerIndex(), + ProposalSlot: headState.Slot(), + ParentBlockNumber: headBlock.Block().Slot(), + ParentBlockRoot: headRoot, + ParentBlockHash: headPayload.BlockHash(), + PayloadAttributesV2: &enginev1.PayloadAttributesV2{ + Timestamp: uint64(t.Unix()), + PrevRandao: prevRando, + SuggestedFeeRecipient: headPayload.FeeRecipient(), + Withdrawals: withdrawals, + }, + }, + }) + default: + return errors.New("payload version is not supported") + } +} + func streamData(stream ethpbservice.Events_StreamEventsServer, name string, data proto.Message) error { returnData, err := anypb.New(data) if err != nil { diff --git a/beacon-chain/rpc/eth/events/server.go b/beacon-chain/rpc/eth/events/server.go index f587936799ce..dfa809c530bd 100644 --- a/beacon-chain/rpc/eth/events/server.go +++ b/beacon-chain/rpc/eth/events/server.go @@ -6,6 +6,7 @@ package events import ( "context" + "github.com/prysmaticlabs/prysm/v3/beacon-chain/blockchain" blockfeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/block" opfeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/operation" statefeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/state" @@ -18,4 +19,5 @@ type Server struct { StateNotifier statefeed.Notifier BlockNotifier blockfeed.Notifier OperationNotifier opfeed.Notifier + HeadFetcher blockchain.HeadFetcher } diff --git a/beacon-chain/rpc/service.go b/beacon-chain/rpc/service.go index ca48c50500c0..07a45b780af9 100644 --- a/beacon-chain/rpc/service.go +++ b/beacon-chain/rpc/service.go @@ -335,6 +335,7 @@ func (s *Service) Start() { StateNotifier: s.cfg.StateNotifier, BlockNotifier: s.cfg.BlockNotifier, OperationNotifier: s.cfg.OperationNotifier, + HeadFetcher: s.cfg.HeadFetcher, }) if s.cfg.EnableDebugRPCEndpoints { log.Info("Enabled debug gRPC endpoints") diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index 7fa41b06fd6e..5be5132af64c 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -254,10 +254,4 @@ var ( Usage: "Directory for the slasher database", Value: cmd.DefaultDataDir(), } - - // AlwaysPreparePayload for forcing payload attributes to be sent every fork choice update, used for builders and relays. - AlwaysPreparePayload = &cli.BoolFlag{ - Name: "always-prepare-payload", - Usage: "Forces payload attributes to be sent with every FCU regardless of connected proposers. This is intended for use by builders/relays.", - } ) diff --git a/cmd/beacon-chain/main.go b/cmd/beacon-chain/main.go index ff21dc9e1801..ab737190abfc 100644 --- a/cmd/beacon-chain/main.go +++ b/cmd/beacon-chain/main.go @@ -130,7 +130,6 @@ var appFlags = []cli.Flag{ genesis.StatePath, genesis.BeaconAPIURL, flags.SlasherDirFlag, - flags.AlwaysPreparePayload, } func init() { diff --git a/cmd/beacon-chain/usage.go b/cmd/beacon-chain/usage.go index e4df820e345c..53d2928c581b 100644 --- a/cmd/beacon-chain/usage.go +++ b/cmd/beacon-chain/usage.go @@ -126,7 +126,6 @@ var appHelpFlagGroups = []flagGroup{ flags.MaxBuilderConsecutiveMissedSlots, flags.EngineEndpointTimeoutSeconds, flags.SlasherDirFlag, - flags.AlwaysPreparePayload, checkpoint.BlockPath, checkpoint.StatePath, checkpoint.RemoteURL, From ed02d0cece6bf7dd8ec1fd900b1f3268e3adbca2 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Mon, 13 Mar 2023 20:34:25 -0500 Subject: [PATCH 17/31] reverting some changes --- beacon-chain/blockchain/execution_engine.go | 5 ++-- .../blockchain/execution_engine_test.go | 23 ------------------- beacon-chain/blockchain/options.go | 8 ------- beacon-chain/blockchain/service.go | 1 - beacon-chain/core/feed/state/events.go | 2 -- beacon-chain/node/node.go | 1 + 6 files changed, 3 insertions(+), 37 deletions(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 79e9474482b9..0da591a85283 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -69,7 +69,7 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho } nextSlot := s.CurrentSlot() + 1 // Cache payload ID for next slot proposer. - hasAttr, attr, proposerId := s.getPayloadAttribute(ctx, arg.headBlock, arg.headState, nextSlot) + hasAttr, attr, proposerId := s.getPayloadAttribute(ctx, arg.headState, nextSlot) fmt.Printf("using headblock for proposer ID: %v", proposerId) payloadID, lastValidHash, err := s.cfg.ExecutionEngineCaller.ForkchoiceUpdated(ctx, fcs, attr) if err != nil { @@ -253,12 +253,11 @@ func (s *Service) notifyNewPayload(ctx context.Context, postStateVersion int, // getPayloadAttributes returns the payload attributes for the given state and slot. // The attribute is required to initiate a payload build process in the context of an `engine_forkchoiceUpdated` call. -func (s *Service) getPayloadAttribute(ctx context.Context, blk interfaces.ReadOnlyBeaconBlock, st state.BeaconState, slot primitives.Slot) (bool, payloadattribute.Attributer, primitives.ValidatorIndex) { +func (s *Service) getPayloadAttribute(ctx context.Context, st state.BeaconState, slot primitives.Slot) (bool, payloadattribute.Attributer, primitives.ValidatorIndex) { emptyAttri := payloadattribute.EmptyWithVersion(st.Version()) // Root is `[32]byte{}` since we are retrieving proposer ID of a given slot. During insertion at assignment the root was not known. proposerID, _, ok := s.cfg.ProposerSlotIndexCache.GetProposerPayloadIDs(slot, [32]byte{} /* root */) if !ok { // There's no need to build attribute if there is no proposer for slot. - return false, emptyAttri, 0 } // Get previous randao. diff --git a/beacon-chain/blockchain/execution_engine_test.go b/beacon-chain/blockchain/execution_engine_test.go index 777890dfb9c8..1cb33cc7af15 100644 --- a/beacon-chain/blockchain/execution_engine_test.go +++ b/beacon-chain/blockchain/execution_engine_test.go @@ -827,16 +827,6 @@ func Test_GetPayloadAttribute(t *testing.T) { require.Equal(t, true, hasPayload) require.Equal(t, suggestedVid, vId) require.Equal(t, suggestedAddr, common.BytesToAddress(attr.SuggestedFeeRecipient())) - - // Override for non proposer - service.cfg.AlwaysPreparePayload = true - err = service.cfg.BeaconDB.SaveFeeRecipientsByValidatorIDs(ctx, []primitives.ValidatorIndex{b.ProposerIndex()}, []common.Address{suggestedAddr}) - require.NoError(t, err) - require.NoError(t, service.cfg.BeaconDB.SaveFeeRecipientsByValidatorIDs(ctx, []primitives.ValidatorIndex{suggestedVid}, []common.Address{suggestedAddr})) - hasPayload, attr, vId = service.getPayloadAttribute(ctx, b, st, slot) - require.Equal(t, true, hasPayload) - require.Equal(t, suggestedVid, vId) - require.Equal(t, suggestedAddr, common.BytesToAddress(attr.SuggestedFeeRecipient())) } func Test_GetPayloadAttributeV2(t *testing.T) { @@ -889,19 +879,6 @@ func Test_GetPayloadAttributeV2(t *testing.T) { a, err = attr.Withdrawals() require.NoError(t, err) require.Equal(t, 0, len(a)) - - // Override for non proposer - service.cfg.AlwaysPreparePayload = true - err = service.cfg.BeaconDB.SaveFeeRecipientsByValidatorIDs(ctx, []primitives.ValidatorIndex{b.ProposerIndex()}, []common.Address{suggestedAddr}) - require.NoError(t, err) - require.NoError(t, service.cfg.BeaconDB.SaveFeeRecipientsByValidatorIDs(ctx, []primitives.ValidatorIndex{suggestedVid}, []common.Address{suggestedAddr})) - hasPayload, attr, vId = service.getPayloadAttribute(ctx, b, st, slot) - require.Equal(t, true, hasPayload) - require.Equal(t, suggestedVid, vId) - require.Equal(t, suggestedAddr, common.BytesToAddress(attr.SuggestedFeeRecipient())) - a, err = attr.Withdrawals() - require.NoError(t, err) - require.Equal(t, 0, len(a)) } func Test_UpdateLastValidatedCheckpoint(t *testing.T) { diff --git a/beacon-chain/blockchain/options.go b/beacon-chain/blockchain/options.go index 104b72969410..f89efda960eb 100644 --- a/beacon-chain/blockchain/options.go +++ b/beacon-chain/blockchain/options.go @@ -163,11 +163,3 @@ func WithFinalizedStateAtStartUp(st state.BeaconState) Option { return nil } } - -// WithAlwaysPreparePayload sets payload attributes to submit on slots -func WithAlwaysPreparePayload(is bool) Option { - return func(s *Service) error { - s.cfg.AlwaysPreparePayload = is - return nil - } -} diff --git a/beacon-chain/blockchain/service.go b/beacon-chain/blockchain/service.go index c1965e39f13e..2d1441bb9eda 100644 --- a/beacon-chain/blockchain/service.go +++ b/beacon-chain/blockchain/service.go @@ -81,7 +81,6 @@ type config struct { BlockFetcher execution.POWBlockFetcher FinalizedStateAtStartUp state.BeaconState ExecutionEngineCaller execution.EngineCaller - AlwaysPreparePayload bool } // NewService instantiates a new block service instance that will diff --git a/beacon-chain/core/feed/state/events.go b/beacon-chain/core/feed/state/events.go index 5974bb56293f..2b1364691755 100644 --- a/beacon-chain/core/feed/state/events.go +++ b/beacon-chain/core/feed/state/events.go @@ -26,8 +26,6 @@ const ( FinalizedCheckpoint // NewHead of the chain event. NewHead - // PayloadAttributeSent is sent when a node computed a new payload attributes for execution payload building - PayloadAttributeSent ) // BlockProcessedData is the data sent with BlockProcessed events. diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index 4ed1941e2139..a4d0d9584eba 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -609,6 +609,7 @@ func (b *BeaconNode) registerBlockchainService(fc forkchoice.ForkChoicer) error blockchain.WithFinalizedStateAtStartUp(b.finalizedStateAtStartUp), blockchain.WithProposerIdsCache(b.proposerIdsCache), ) + blockchainService, err := blockchain.NewService(b.ctx, opts...) if err != nil { return errors.Wrap(err, "could not register blockchain service") From 81d4b80bb851a4d69d215ac28207b45a9058452b Mon Sep 17 00:00:00 2001 From: james-prysm Date: Mon, 13 Mar 2023 20:37:48 -0500 Subject: [PATCH 18/31] reverting more logic --- beacon-chain/blockchain/execution_engine.go | 3 --- .../blockchain/execution_engine_test.go | 27 +++++-------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 0da591a85283..35694e4900cb 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -70,7 +70,6 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho nextSlot := s.CurrentSlot() + 1 // Cache payload ID for next slot proposer. hasAttr, attr, proposerId := s.getPayloadAttribute(ctx, arg.headState, nextSlot) - fmt.Printf("using headblock for proposer ID: %v", proposerId) payloadID, lastValidHash, err := s.cfg.ExecutionEngineCaller.ForkchoiceUpdated(ctx, fcs, attr) if err != nil { switch err { @@ -144,7 +143,6 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho } } forkchoiceUpdatedValidNodeCount.Inc() - if err := s.cfg.ForkChoiceStore.SetOptimisticToValid(ctx, arg.headRoot); err != nil { log.WithError(err).Error("Could not set head root to valid") return nil, nil @@ -212,7 +210,6 @@ func (s *Service) notifyNewPayload(ctx context.Context, postStateVersion int, switch err { case nil: newPayloadValidNodeCount.Inc() - blk.Version() return true, nil case execution.ErrAcceptedSyncingPayloadStatus: newPayloadOptimisticNodeCount.Inc() diff --git a/beacon-chain/blockchain/execution_engine_test.go b/beacon-chain/blockchain/execution_engine_test.go index 1cb33cc7af15..0981650d2e5c 100644 --- a/beacon-chain/blockchain/execution_engine_test.go +++ b/beacon-chain/blockchain/execution_engine_test.go @@ -794,17 +794,12 @@ func Test_GetPayloadAttribute(t *testing.T) { WithStateGen(stategen.New(beaconDB, doublylinkedtree.New())), WithProposerIdsCache(cache.NewProposerPayloadIDsCache()), } - b, err := consensusblocks.NewBeaconBlock(ðpb.BeaconBlockBellatrix{ - Body: ðpb.BeaconBlockBodyBellatrix{ - ExecutionPayload: &v1.ExecutionPayload{}, - }, - }) - require.NoError(t, err) + // Cache miss service, err := NewService(ctx, opts...) require.NoError(t, err) st, _ := util.DeterministicGenesisStateBellatrix(t, 1) - hasPayload, _, vId := service.getPayloadAttribute(ctx, b, st, 0) + hasPayload, _, vId := service.getPayloadAttribute(ctx, st, 0) require.Equal(t, false, hasPayload) require.Equal(t, primitives.ValidatorIndex(0), vId) @@ -813,7 +808,7 @@ func Test_GetPayloadAttribute(t *testing.T) { slot := primitives.Slot(1) service.cfg.ProposerSlotIndexCache.SetProposerAndPayloadIDs(slot, suggestedVid, [8]byte{}, [32]byte{}) hook := logTest.NewGlobal() - hasPayload, attr, vId := service.getPayloadAttribute(ctx, b, st, slot) + hasPayload, attr, vId := service.getPayloadAttribute(ctx, st, slot) require.Equal(t, true, hasPayload) require.Equal(t, suggestedVid, vId) require.Equal(t, params.BeaconConfig().EthBurnAddressHex, common.BytesToAddress(attr.SuggestedFeeRecipient()).String()) @@ -823,7 +818,7 @@ func Test_GetPayloadAttribute(t *testing.T) { suggestedAddr := common.HexToAddress("123") require.NoError(t, service.cfg.BeaconDB.SaveFeeRecipientsByValidatorIDs(ctx, []primitives.ValidatorIndex{suggestedVid}, []common.Address{suggestedAddr})) service.cfg.ProposerSlotIndexCache.SetProposerAndPayloadIDs(slot, suggestedVid, [8]byte{}, [32]byte{}) - hasPayload, attr, vId = service.getPayloadAttribute(ctx, b, st, slot) + hasPayload, attr, vId = service.getPayloadAttribute(ctx, st, slot) require.Equal(t, true, hasPayload) require.Equal(t, suggestedVid, vId) require.Equal(t, suggestedAddr, common.BytesToAddress(attr.SuggestedFeeRecipient())) @@ -837,20 +832,12 @@ func Test_GetPayloadAttributeV2(t *testing.T) { WithStateGen(stategen.New(beaconDB, doublylinkedtree.New())), WithProposerIdsCache(cache.NewProposerPayloadIDsCache()), } - b, err := consensusblocks.NewBeaconBlock(ðpb.BeaconBlockCapella{ - Slot: 1, - ProposerIndex: 1, - Body: ðpb.BeaconBlockBodyCapella{ - ExecutionPayload: &v1.ExecutionPayloadCapella{}, - }, - }) - require.NoError(t, err) // Cache miss service, err := NewService(ctx, opts...) require.NoError(t, err) st, _ := util.DeterministicGenesisStateCapella(t, 1) - hasPayload, _, vId := service.getPayloadAttribute(ctx, b, st, 0) + hasPayload, _, vId := service.getPayloadAttribute(ctx, st, 0) require.Equal(t, false, hasPayload) require.Equal(t, primitives.ValidatorIndex(0), vId) @@ -859,7 +846,7 @@ func Test_GetPayloadAttributeV2(t *testing.T) { slot := primitives.Slot(1) service.cfg.ProposerSlotIndexCache.SetProposerAndPayloadIDs(slot, suggestedVid, [8]byte{}, [32]byte{}) hook := logTest.NewGlobal() - hasPayload, attr, vId := service.getPayloadAttribute(ctx, b, st, slot) + hasPayload, attr, vId := service.getPayloadAttribute(ctx, st, slot) require.Equal(t, true, hasPayload) require.Equal(t, suggestedVid, vId) require.Equal(t, params.BeaconConfig().EthBurnAddressHex, common.BytesToAddress(attr.SuggestedFeeRecipient()).String()) @@ -872,7 +859,7 @@ func Test_GetPayloadAttributeV2(t *testing.T) { suggestedAddr := common.HexToAddress("123") require.NoError(t, service.cfg.BeaconDB.SaveFeeRecipientsByValidatorIDs(ctx, []primitives.ValidatorIndex{suggestedVid}, []common.Address{suggestedAddr})) service.cfg.ProposerSlotIndexCache.SetProposerAndPayloadIDs(slot, suggestedVid, [8]byte{}, [32]byte{}) - hasPayload, attr, vId = service.getPayloadAttribute(ctx, b, st, slot) + hasPayload, attr, vId = service.getPayloadAttribute(ctx, st, slot) require.Equal(t, true, hasPayload) require.Equal(t, suggestedVid, vId) require.Equal(t, suggestedAddr, common.BytesToAddress(attr.SuggestedFeeRecipient())) From 94a591d50e8413b5a193575b3882c05b7847ab00 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Mon, 13 Mar 2023 20:39:58 -0500 Subject: [PATCH 19/31] reverting addition of line --- beacon-chain/blockchain/execution_engine.go | 1 - 1 file changed, 1 deletion(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index 35694e4900cb..f0b6311858e1 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -147,7 +147,6 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho log.WithError(err).Error("Could not set head root to valid") return nil, nil } - // If the forkchoice update call has an attribute, update the proposer payload ID cache. if hasAttr && payloadID != nil { var pId [8]byte From a7a0c7739451ae42da3462a862a6af1fe0e8ecc2 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Mon, 13 Mar 2023 20:50:19 -0500 Subject: [PATCH 20/31] fixing linting --- beacon-chain/rpc/apimiddleware/BUILD.bazel | 1 + beacon-chain/rpc/eth/events/BUILD.bazel | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/beacon-chain/rpc/apimiddleware/BUILD.bazel b/beacon-chain/rpc/apimiddleware/BUILD.bazel index 2569d3b1614f..2e4439cfb33f 100644 --- a/beacon-chain/rpc/apimiddleware/BUILD.bazel +++ b/beacon-chain/rpc/apimiddleware/BUILD.bazel @@ -19,6 +19,7 @@ go_library( "//config/params:go_default_library", "//consensus-types/primitives:go_default_library", "//proto/eth/v2:go_default_library", + "//runtime/version:go_default_library", "//time/slots:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_r3labs_sse//:go_default_library", diff --git a/beacon-chain/rpc/eth/events/BUILD.bazel b/beacon-chain/rpc/eth/events/BUILD.bazel index 4bfea54505c5..9c62f2a6601b 100644 --- a/beacon-chain/rpc/eth/events/BUILD.bazel +++ b/beacon-chain/rpc/eth/events/BUILD.bazel @@ -9,15 +9,22 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v3/beacon-chain/rpc/eth/events", visibility = ["//beacon-chain:__subpackages__"], deps = [ + "//beacon-chain/blockchain:go_default_library", "//beacon-chain/core/feed:go_default_library", "//beacon-chain/core/feed/block:go_default_library", "//beacon-chain/core/feed/operation:go_default_library", "//beacon-chain/core/feed/state:go_default_library", + "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/time:go_default_library", + "//proto/engine/v1:go_default_library", "//proto/eth/service:go_default_library", "//proto/eth/v1:go_default_library", "//proto/migration:go_default_library", + "//runtime/version:go_default_library", + "//time/slots:go_default_library", "@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:go_default_library", "@com_github_pkg_errors//:go_default_library", + "@com_github_sirupsen_logrus//:go_default_library", "@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//status:go_default_library", "@org_golang_google_protobuf//proto:go_default_library", From 71f680453751c87bb278b69cfccc7e05170762a5 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 14 Mar 2023 09:19:31 -0500 Subject: [PATCH 21/31] trying to fix linter --- beacon-chain/rpc/eth/events/events.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 6e0939ed7eb5..8dccfbf7703f 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -11,7 +11,7 @@ import ( statefeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/state" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/time" - "github.com/prysmaticlabs/prysm/v3/proto/engine/v1" + enginev1 "github.com/prysmaticlabs/prysm/v3/proto/engine/v1" ethpbservice "github.com/prysmaticlabs/prysm/v3/proto/eth/service" ethpb "github.com/prysmaticlabs/prysm/v3/proto/eth/v1" "github.com/prysmaticlabs/prysm/v3/proto/migration" From 8a732a3c0c37444ad693d27c071d3300faf16955 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 14 Mar 2023 09:35:53 -0500 Subject: [PATCH 22/31] fixing log --- beacon-chain/rpc/eth/events/events.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 8dccfbf7703f..4e9c45fc2025 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -220,7 +220,7 @@ func (s *Server) handleStateEvents( } if _, ok := requestedTopics[PayloadAttributesTopic]; ok { if err := s.streamPayloadAttributes(stream); err != nil { - log.Error("Unable to obtain stream payload attributes: %v", err) + log.Errorf("Unable to obtain stream payload attributes: %v", err) } return nil } From 4f02831070f10fb181a5f354f2bff123da22c743 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 14 Mar 2023 09:38:15 -0500 Subject: [PATCH 23/31] updating log recommendations --- beacon-chain/rpc/eth/events/events.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 4e9c45fc2025..0da13972cb7e 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -220,7 +220,7 @@ func (s *Server) handleStateEvents( } if _, ok := requestedTopics[PayloadAttributesTopic]; ok { if err := s.streamPayloadAttributes(stream); err != nil { - log.Errorf("Unable to obtain stream payload attributes: %v", err) + log.WithError(err).Error("Unable to obtain stream payload attributes") } return nil } From 60d6c98aca490b479777a0f591ee333d511faa12 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 14 Mar 2023 13:49:04 -0500 Subject: [PATCH 24/31] wip unit tests --- beacon-chain/rpc/eth/events/events.go | 2 - beacon-chain/rpc/eth/events/events_test.go | 201 +++++++++++++++++++++ 2 files changed, 201 insertions(+), 2 deletions(-) diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 0da13972cb7e..d1638fa6b89c 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -262,13 +262,11 @@ func (s *Server) streamPayloadAttributes(stream ethpbservice.Events_StreamEvents headRoot, err := s.HeadFetcher.HeadRoot(s.Ctx) if err != nil { - return err } headPayload, err := headBlock.Block().Body().Execution() if err != nil { - return err } diff --git a/beacon-chain/rpc/eth/events/events_test.go b/beacon-chain/rpc/eth/events/events_test.go index 2d0355523a27..6e2349e7b38e 100644 --- a/beacon-chain/rpc/eth/events/events_test.go +++ b/beacon-chain/rpc/eth/events/events_test.go @@ -3,17 +3,24 @@ package events import ( "context" "testing" + "time" "github.com/golang/mock/gomock" "github.com/grpc-ecosystem/grpc-gateway/v2/proto/gateway" "github.com/prysmaticlabs/go-bitfield" "github.com/prysmaticlabs/prysm/v3/async/event" mockChain "github.com/prysmaticlabs/prysm/v3/beacon-chain/blockchain/testing" + b "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/blocks" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed" blockfeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/block" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/operation" statefeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/state" + "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/transition" + dbutil "github.com/prysmaticlabs/prysm/v3/beacon-chain/db/testing" + fieldparams "github.com/prysmaticlabs/prysm/v3/config/fieldparams" + "github.com/prysmaticlabs/prysm/v3/config/params" "github.com/prysmaticlabs/prysm/v3/consensus-types/blocks" + enginev1 "github.com/prysmaticlabs/prysm/v3/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v3/proto/eth/v1" "github.com/prysmaticlabs/prysm/v3/proto/migration" eth "github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1" @@ -21,6 +28,7 @@ import ( "github.com/prysmaticlabs/prysm/v3/testing/mock" "github.com/prysmaticlabs/prysm/v3/testing/require" "github.com/prysmaticlabs/prysm/v3/testing/util" + "github.com/prysmaticlabs/prysm/v3/time/slots" "google.golang.org/protobuf/types/known/anypb" ) @@ -312,6 +320,199 @@ func TestStreamEvents_StateEvents(t *testing.T) { feed: srv.StateNotifier.StateFeed(), }) }) + t.Run(PayloadAttributesTopic+"_bellatrix", func(t *testing.T) { + db := dbutil.SetupDB(t) + ctx := context.Background() + transition.SkipSlotCache.Disable() + + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig().Copy() + cfg.BellatrixForkEpoch = 2 + cfg.AltairForkEpoch = 1 + params.OverrideBeaconConfig(cfg) + beaconState, _ := util.DeterministicGenesisState(t, 64) + + stateRoot, err := beaconState.HashTreeRoot(ctx) + require.NoError(t, err, "Could not hash genesis state") + + genesis := b.NewGenesisBlock(stateRoot[:]) + util.SaveBlock(t, ctx, db, genesis) + + parentRoot, err := genesis.Block.HashTreeRoot() + require.NoError(t, err, "Could not get signing root") + require.NoError(t, db.SaveState(ctx, beaconState, parentRoot), "Could not save genesis state") + require.NoError(t, db.SaveHeadBlockRoot(ctx, parentRoot), "Could not save genesis state") + + bellatrixSlot, err := slots.EpochStart(params.BeaconConfig().BellatrixForkEpoch) + require.NoError(t, err) + + var scBits [fieldparams.SyncAggregateSyncCommitteeBytesLength]byte + blk := ð.SignedBeaconBlockBellatrix{ + Block: ð.BeaconBlockBellatrix{ + Slot: bellatrixSlot + 1, + ParentRoot: parentRoot[:], + StateRoot: genesis.Block.StateRoot, + Body: ð.BeaconBlockBodyBellatrix{ + RandaoReveal: genesis.Block.Body.RandaoReveal, + Graffiti: genesis.Block.Body.Graffiti, + Eth1Data: genesis.Block.Body.Eth1Data, + SyncAggregate: ð.SyncAggregate{SyncCommitteeBits: scBits[:], SyncCommitteeSignature: make([]byte, 96)}, + ExecutionPayload: &enginev1.ExecutionPayload{ + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, fieldparams.LogsBloomLength), + PrevRandao: make([]byte, fieldparams.RootLength), + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + }, + }, + }, + Signature: genesis.Signature, + } + + blkRoot, err := blk.Block.HashTreeRoot() + require.NoError(t, err) + require.NoError(t, err, "Could not get signing root") + require.NoError(t, db.SaveState(ctx, beaconState, blkRoot), "Could not save genesis state") + require.NoError(t, db.SaveHeadBlockRoot(ctx, blkRoot), "Could not save genesis state") + + srv, ctrl, mockStream := setupServer(ctx, t) + defer ctrl.Finish() + srv.HeadFetcher = &mockChain.ChainService{ + Genesis: time.Now(), + DB: db, + State: beaconState, + Root: []byte("hello-world"), + ValidatorsRoot: [32]byte{}, + } + wantedPayload := ðpb.EventPayloadAttributeV1_BasePayloadAttribute{ + ProposerIndex: 1, + ProposalSlot: 2, + ParentBlockNumber: 1, + ParentBlockRoot: make([]byte, 32), + ParentBlockHash: make([]byte, 32), + PayloadAttributes: &enginev1.PayloadAttributes{ + Timestamp: uint64(time.Now().Unix()), + PrevRandao: make([]byte, 32), + SuggestedFeeRecipient: make([]byte, 20), + }, + } + genericResponse, err := anypb.New(wantedPayload) + require.NoError(t, err) + wantedMessage := &gateway.EventSource{ + Event: PayloadAttributesTopic, + Data: genericResponse, + } + + assertFeedSendAndReceive(ctx, &assertFeedArgs{ + t: t, + srv: srv, + topics: []string{PayloadAttributesTopic}, + stream: mockStream, + shouldReceive: wantedMessage, + itemToSend: &feed.Event{ + Type: statefeed.NewHead, + Data: wantedPayload, + }, + feed: srv.StateNotifier.StateFeed(), + }) + }) + t.Run(PayloadAttributesTopic+"_capella", func(t *testing.T) { + ctx := context.Background() + db := dbutil.SetupDB(t) + transition.SkipSlotCache.Disable() + + params.SetupTestConfigCleanup(t) + cfg := params.BeaconConfig().Copy() + cfg.CapellaForkEpoch = 3 + cfg.BellatrixForkEpoch = 2 + cfg.AltairForkEpoch = 1 + params.OverrideBeaconConfig(cfg) + beaconState, _ := util.DeterministicGenesisState(t, 64) + + stateRoot, err := beaconState.HashTreeRoot(ctx) + require.NoError(t, err, "Could not hash genesis state") + + genesis := b.NewGenesisBlock(stateRoot[:]) + util.SaveBlock(t, ctx, db, genesis) + + parentRoot, err := genesis.Block.HashTreeRoot() + require.NoError(t, err, "Could not get signing root") + require.NoError(t, db.SaveState(ctx, beaconState, parentRoot), "Could not save genesis state") + require.NoError(t, db.SaveHeadBlockRoot(ctx, parentRoot), "Could not save genesis state") + + capellaSlot, err := slots.EpochStart(params.BeaconConfig().CapellaForkEpoch) + require.NoError(t, err) + + var scBits [fieldparams.SyncAggregateSyncCommitteeBytesLength]byte + blk := ð.SignedBeaconBlockCapella{ + Block: ð.BeaconBlockCapella{ + Slot: capellaSlot + 1, + ParentRoot: parentRoot[:], + StateRoot: genesis.Block.StateRoot, + Body: ð.BeaconBlockBodyCapella{ + RandaoReveal: genesis.Block.Body.RandaoReveal, + Graffiti: genesis.Block.Body.Graffiti, + Eth1Data: genesis.Block.Body.Eth1Data, + SyncAggregate: ð.SyncAggregate{SyncCommitteeBits: scBits[:], SyncCommitteeSignature: make([]byte, 96)}, + ExecutionPayload: &enginev1.ExecutionPayloadCapella{ + ParentHash: make([]byte, fieldparams.RootLength), + FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), + StateRoot: make([]byte, fieldparams.RootLength), + ReceiptsRoot: make([]byte, fieldparams.RootLength), + LogsBloom: make([]byte, fieldparams.LogsBloomLength), + PrevRandao: make([]byte, fieldparams.RootLength), + BaseFeePerGas: make([]byte, fieldparams.RootLength), + BlockHash: make([]byte, fieldparams.RootLength), + }, + }, + }, + Signature: genesis.Signature, + } + + blkRoot, err := blk.Block.HashTreeRoot() + require.NoError(t, err) + require.NoError(t, err, "Could not get signing root") + require.NoError(t, db.SaveState(ctx, beaconState, blkRoot), "Could not save genesis state") + require.NoError(t, db.SaveHeadBlockRoot(ctx, blkRoot), "Could not save genesis state") + srv, ctrl, mockStream := setupServer(ctx, t) + defer ctrl.Finish() + + wantedPayload := ðpb.EventPayloadAttributeV2_BasePayloadAttribute{ + ProposerIndex: 1, + ProposalSlot: 2, + ParentBlockNumber: 1, + ParentBlockRoot: make([]byte, 32), + ParentBlockHash: make([]byte, 32), + PayloadAttributesV2: &enginev1.PayloadAttributesV2{ + Timestamp: uint64(time.Now().Unix()), + PrevRandao: make([]byte, 32), + SuggestedFeeRecipient: make([]byte, 20), + Withdrawals: make([]*enginev1.Withdrawal, 1), + }, + } + genericResponse, err := anypb.New(wantedPayload) + require.NoError(t, err) + wantedMessage := &gateway.EventSource{ + Event: PayloadAttributesTopic, + Data: genericResponse, + } + + assertFeedSendAndReceive(ctx, &assertFeedArgs{ + t: t, + srv: srv, + topics: []string{PayloadAttributesTopic}, + stream: mockStream, + shouldReceive: wantedMessage, + itemToSend: &feed.Event{ + Type: statefeed.NewHead, + Data: wantedPayload, + }, + feed: srv.StateNotifier.StateFeed(), + }) + }) t.Run(FinalizedCheckpointTopic, func(t *testing.T) { ctx := context.Background() srv, ctrl, mockStream := setupServer(ctx, t) From 74f20eb101c445625bea282bcb49562cf5abdac6 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 14 Mar 2023 14:44:10 -0500 Subject: [PATCH 25/31] WIP fixes on review --- beacon-chain/rpc/eth/events/events.go | 2 +- beacon-chain/rpc/eth/events/events_test.go | 143 ++++++++++----------- proto/eth/v1/events.proto | 4 +- 3 files changed, 69 insertions(+), 80 deletions(-) diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index d1638fa6b89c..d5f73e80044f 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -287,7 +287,7 @@ func (s *Server) streamPayloadAttributes(stream ethpbservice.Events_StreamEvents Data: ðpb.EventPayloadAttributeV1_BasePayloadAttribute{ ProposerIndex: headBlock.Block().ProposerIndex(), ProposalSlot: headState.Slot(), - ParentBlockNumber: headBlock.Block().Slot(), + ParentBlockNumber: headPayload.BlockNumber(), ParentBlockRoot: headRoot, ParentBlockHash: headPayload.BlockHash(), PayloadAttributes: &enginev1.PayloadAttributes{ diff --git a/beacon-chain/rpc/eth/events/events_test.go b/beacon-chain/rpc/eth/events/events_test.go index 6e2349e7b38e..5aa17496528f 100644 --- a/beacon-chain/rpc/eth/events/events_test.go +++ b/beacon-chain/rpc/eth/events/events_test.go @@ -24,6 +24,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v3/proto/eth/v1" "github.com/prysmaticlabs/prysm/v3/proto/migration" eth "github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1" + "github.com/prysmaticlabs/prysm/v3/runtime/version" "github.com/prysmaticlabs/prysm/v3/testing/assert" "github.com/prysmaticlabs/prysm/v3/testing/mock" "github.com/prysmaticlabs/prysm/v3/testing/require" @@ -286,70 +287,58 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { } func TestStreamEvents_StateEvents(t *testing.T) { - t.Run(HeadTopic, func(t *testing.T) { - ctx := context.Background() - srv, ctrl, mockStream := setupServer(ctx, t) - defer ctrl.Finish() - - wantedHead := ðpb.EventHead{ - Slot: 8, - Block: make([]byte, 32), - State: make([]byte, 32), - EpochTransition: true, - PreviousDutyDependentRoot: make([]byte, 32), - CurrentDutyDependentRoot: make([]byte, 32), - ExecutionOptimistic: true, - } - genericResponse, err := anypb.New(wantedHead) - require.NoError(t, err) - wantedMessage := &gateway.EventSource{ - Event: HeadTopic, - Data: genericResponse, - } - - assertFeedSendAndReceive(ctx, &assertFeedArgs{ - t: t, - srv: srv, - topics: []string{HeadTopic}, - stream: mockStream, - shouldReceive: wantedMessage, - itemToSend: &feed.Event{ - Type: statefeed.NewHead, - Data: wantedHead, - }, - feed: srv.StateNotifier.StateFeed(), - }) - }) + //t.Run(HeadTopic, func(t *testing.T) { + // ctx := context.Background() + // srv, ctrl, mockStream := setupServer(ctx, t) + // defer ctrl.Finish() + // + // wantedHead := ðpb.EventHead{ + // Slot: 8, + // Block: make([]byte, 32), + // State: make([]byte, 32), + // EpochTransition: true, + // PreviousDutyDependentRoot: make([]byte, 32), + // CurrentDutyDependentRoot: make([]byte, 32), + // ExecutionOptimistic: true, + // } + // genericResponse, err := anypb.New(wantedHead) + // require.NoError(t, err) + // wantedMessage := &gateway.EventSource{ + // Event: HeadTopic, + // Data: genericResponse, + // } + // + // assertFeedSendAndReceive(ctx, &assertFeedArgs{ + // t: t, + // srv: srv, + // topics: []string{HeadTopic}, + // stream: mockStream, + // shouldReceive: wantedMessage, + // itemToSend: &feed.Event{ + // Type: statefeed.NewHead, + // Data: wantedHead, + // }, + // feed: srv.StateNotifier.StateFeed(), + // }) + //}) t.Run(PayloadAttributesTopic+"_bellatrix", func(t *testing.T) { - db := dbutil.SetupDB(t) ctx := context.Background() - transition.SkipSlotCache.Disable() params.SetupTestConfigCleanup(t) - cfg := params.BeaconConfig().Copy() - cfg.BellatrixForkEpoch = 2 - cfg.AltairForkEpoch = 1 - params.OverrideBeaconConfig(cfg) - beaconState, _ := util.DeterministicGenesisState(t, 64) + beaconState, _ := util.DeterministicGenesisStateBellatrix(t, 1) stateRoot, err := beaconState.HashTreeRoot(ctx) require.NoError(t, err, "Could not hash genesis state") genesis := b.NewGenesisBlock(stateRoot[:]) - util.SaveBlock(t, ctx, db, genesis) parentRoot, err := genesis.Block.HashTreeRoot() require.NoError(t, err, "Could not get signing root") - require.NoError(t, db.SaveState(ctx, beaconState, parentRoot), "Could not save genesis state") - require.NoError(t, db.SaveHeadBlockRoot(ctx, parentRoot), "Could not save genesis state") - - bellatrixSlot, err := slots.EpochStart(params.BeaconConfig().BellatrixForkEpoch) - require.NoError(t, err) var scBits [fieldparams.SyncAggregateSyncCommitteeBytesLength]byte blk := ð.SignedBeaconBlockBellatrix{ Block: ð.BeaconBlockBellatrix{ - Slot: bellatrixSlot + 1, + Slot: 1, ParentRoot: parentRoot[:], StateRoot: genesis.Block.StateRoot, Body: ð.BeaconBlockBodyBellatrix{ @@ -371,32 +360,29 @@ func TestStreamEvents_StateEvents(t *testing.T) { }, Signature: genesis.Signature, } - - blkRoot, err := blk.Block.HashTreeRoot() - require.NoError(t, err) - require.NoError(t, err, "Could not get signing root") - require.NoError(t, db.SaveState(ctx, beaconState, blkRoot), "Could not save genesis state") - require.NoError(t, db.SaveHeadBlockRoot(ctx, blkRoot), "Could not save genesis state") - + signedBlk, err := blocks.NewSignedBeaconBlock(blk) srv, ctrl, mockStream := setupServer(ctx, t) defer ctrl.Finish() srv.HeadFetcher = &mockChain.ChainService{ Genesis: time.Now(), - DB: db, State: beaconState, + Block: signedBlk, Root: []byte("hello-world"), ValidatorsRoot: [32]byte{}, } - wantedPayload := ðpb.EventPayloadAttributeV1_BasePayloadAttribute{ - ProposerIndex: 1, - ProposalSlot: 2, - ParentBlockNumber: 1, - ParentBlockRoot: make([]byte, 32), - ParentBlockHash: make([]byte, 32), - PayloadAttributes: &enginev1.PayloadAttributes{ - Timestamp: uint64(time.Now().Unix()), - PrevRandao: make([]byte, 32), - SuggestedFeeRecipient: make([]byte, 20), + wantedPayload := ðpb.EventPayloadAttributeV1{ + Version: version.String(version.Bellatrix), + Data: ðpb.EventPayloadAttributeV1_BasePayloadAttribute{ + ProposerIndex: 1, + ProposalSlot: 2, + ParentBlockNumber: 1, + ParentBlockRoot: make([]byte, 32), + ParentBlockHash: make([]byte, 32), + PayloadAttributes: &enginev1.PayloadAttributes{ + Timestamp: uint64(time.Now().Unix()), + PrevRandao: make([]byte, 32), + SuggestedFeeRecipient: make([]byte, 20), + }, }, } genericResponse, err := anypb.New(wantedPayload) @@ -480,17 +466,20 @@ func TestStreamEvents_StateEvents(t *testing.T) { srv, ctrl, mockStream := setupServer(ctx, t) defer ctrl.Finish() - wantedPayload := ðpb.EventPayloadAttributeV2_BasePayloadAttribute{ - ProposerIndex: 1, - ProposalSlot: 2, - ParentBlockNumber: 1, - ParentBlockRoot: make([]byte, 32), - ParentBlockHash: make([]byte, 32), - PayloadAttributesV2: &enginev1.PayloadAttributesV2{ - Timestamp: uint64(time.Now().Unix()), - PrevRandao: make([]byte, 32), - SuggestedFeeRecipient: make([]byte, 20), - Withdrawals: make([]*enginev1.Withdrawal, 1), + wantedPayload := ðpb.EventPayloadAttributeV2{ + Version: version.String(version.Capella), + Data: ðpb.EventPayloadAttributeV2_BasePayloadAttribute{ + ProposerIndex: 1, + ProposalSlot: 2, + ParentBlockNumber: 1, + ParentBlockRoot: make([]byte, 32), + ParentBlockHash: make([]byte, 32), + PayloadAttributesV2: &enginev1.PayloadAttributesV2{ + Timestamp: uint64(time.Now().Unix()), + PrevRandao: make([]byte, 32), + SuggestedFeeRecipient: make([]byte, 20), + Withdrawals: make([]*enginev1.Withdrawal, 1), + }, }, } genericResponse, err := anypb.New(wantedPayload) diff --git a/proto/eth/v1/events.proto b/proto/eth/v1/events.proto index e2dc313ff2ce..3095fa06df2a 100644 --- a/proto/eth/v1/events.proto +++ b/proto/eth/v1/events.proto @@ -115,7 +115,7 @@ message EventPayloadAttributeV1 { uint64 proposal_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; // The execution block number of the parent block, which is also the Slot number. - uint64 parent_block_number = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + uint64 parent_block_number = 4; // The beacon block root of the parent block to be built upon. bytes parent_block_root = 5 [(ethereum.eth.ext.ssz_size) = "32"]; @@ -144,7 +144,7 @@ message EventPayloadAttributeV2 { uint64 proposal_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; // The execution block number of the parent block, which is also the Slot number. - uint64 parent_block_number = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; + uint64 parent_block_number = 4; // The beacon block root of the parent block to be built upon. bytes parent_block_root = 5 [(ethereum.eth.ext.ssz_size) = "32"]; From c18d773bbc8eac0d7a224151849e5ca9e214f574 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 14 Mar 2023 14:48:16 -0500 Subject: [PATCH 26/31] updating generated file --- proto/eth/v1/events.pb.go | 161 ++++++++++++++++++-------------------- 1 file changed, 76 insertions(+), 85 deletions(-) diff --git a/proto/eth/v1/events.pb.go b/proto/eth/v1/events.pb.go index cecfe570238a..08246001f2c4 100755 --- a/proto/eth/v1/events.pb.go +++ b/proto/eth/v1/events.pb.go @@ -520,7 +520,7 @@ type EventPayloadAttributeV1_BasePayloadAttribute struct { unknownFields protoimpl.UnknownFields ProposalSlot github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=proposal_slot,json=proposalSlot,proto3" json:"proposal_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` - ParentBlockNumber github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,4,opt,name=parent_block_number,json=parentBlockNumber,proto3" json:"parent_block_number,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` + ParentBlockNumber uint64 `protobuf:"varint,4,opt,name=parent_block_number,json=parentBlockNumber,proto3" json:"parent_block_number,omitempty"` ParentBlockRoot []byte `protobuf:"bytes,5,opt,name=parent_block_root,json=parentBlockRoot,proto3" json:"parent_block_root,omitempty" ssz-size:"32"` ParentBlockHash []byte `protobuf:"bytes,6,opt,name=parent_block_hash,json=parentBlockHash,proto3" json:"parent_block_hash,omitempty" ssz-size:"32"` ProposerIndex github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex `protobuf:"varint,7,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"` @@ -566,11 +566,11 @@ func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetProposalSlot() github_ return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) } -func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetParentBlockNumber() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { +func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetParentBlockNumber() uint64 { if x != nil { return x.ParentBlockNumber } - return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) + return 0 } func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetParentBlockRoot() []byte { @@ -607,7 +607,7 @@ type EventPayloadAttributeV2_BasePayloadAttribute struct { unknownFields protoimpl.UnknownFields ProposalSlot github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=proposal_slot,json=proposalSlot,proto3" json:"proposal_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` - ParentBlockNumber github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot `protobuf:"varint,4,opt,name=parent_block_number,json=parentBlockNumber,proto3" json:"parent_block_number,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"` + ParentBlockNumber uint64 `protobuf:"varint,4,opt,name=parent_block_number,json=parentBlockNumber,proto3" json:"parent_block_number,omitempty"` ParentBlockRoot []byte `protobuf:"bytes,5,opt,name=parent_block_root,json=parentBlockRoot,proto3" json:"parent_block_root,omitempty" ssz-size:"32"` ParentBlockHash []byte `protobuf:"bytes,6,opt,name=parent_block_hash,json=parentBlockHash,proto3" json:"parent_block_hash,omitempty" ssz-size:"32"` ProposerIndex github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.ValidatorIndex `protobuf:"varint,7,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"` @@ -653,11 +653,11 @@ func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetProposalSlot() github_ return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) } -func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetParentBlockNumber() github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot { +func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetParentBlockNumber() uint64 { if x != nil { return x.ParentBlockNumber } - return github_com_prysmaticlabs_prysm_v3_consensus_types_primitives.Slot(0) + return 0 } func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetParentBlockRoot() []byte { @@ -783,7 +783,7 @@ var file_proto_eth_v1_events_proto_rawDesc = []byte{ 0x65, 0x70, 0x6f, 0x63, 0x68, 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, 0x04, 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, 0xb8, 0x05, 0x0a, 0x17, 0x45, 0x76, 0x65, + 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x22, 0xf1, 0x04, 0x0a, 0x17, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x31, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x51, @@ -792,7 +792,7 @@ var file_proto_eth_v1_events_proto_rawDesc = []byte{ 0x76, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x1a, 0xaf, 0x04, 0x0a, 0x14, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x61, 0x1a, 0xe8, 0x03, 0x0a, 0x14, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x6a, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, @@ -800,86 +800,77 @@ var file_proto_eth_v1_events_proto_rawDesc = []byte{ 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x33, 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, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x61, 0x6c, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x75, 0x0a, 0x13, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x61, 0x6c, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 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, 0x33, 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, 0x11, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x32, 0x0a, - 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, - 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, - 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, - 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x07, 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, 0x33, 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, 0x0d, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x54, 0x0a, - 0x12, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x01, 0x28, 0x04, 0x52, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x76, + 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x07, 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, 0x33, 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, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x54, 0x0a, 0x12, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, + 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x52, 0x11, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0xf8, 0x04, 0x0a, + 0x17, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x32, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x3d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x32, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xef, 0x03, 0x0a, 0x14, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x6a, + 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, + 0x03, 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, 0x33, 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, 0x0c, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x32, + 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, + 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x07, 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, + 0x33, 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, 0x0d, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x5b, 0x0a, 0x15, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x5f, 0x76, 0x32, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, - 0x52, 0x11, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x73, 0x22, 0xbf, 0x05, 0x0a, 0x17, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, 0x32, 0x12, - 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x56, - 0x32, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xb6, 0x04, 0x0a, - 0x14, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x6a, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 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, 0x33, 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, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x6c, 0x6f, - 0x74, 0x12, 0x75, 0x0a, 0x13, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 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, 0x33, 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, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x32, 0x0a, 0x11, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, - 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, - 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x07, 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, 0x33, 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, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x5b, 0x0a, 0x15, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x76, - 0x32, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, - 0x52, 0x13, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x73, 0x56, 0x32, 0x42, 0x7e, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, - 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x42, 0x65, - 0x61, 0x63, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x2e, 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, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, - 0x31, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, - 0x74, 0x68, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x56, 0x32, 0x52, 0x13, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x56, 0x32, 0x42, 0x7e, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x42, 0x11, + 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x2e, 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, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, + 0x74, 0x68, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From 9e023d63c79b068c7b11aea18b84e44383ee6126 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 14 Mar 2023 14:53:21 -0500 Subject: [PATCH 27/31] WIP unit test changes --- beacon-chain/rpc/eth/events/events.go | 2 +- beacon-chain/rpc/eth/events/events_test.go | 22 ++-------------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index d5f73e80044f..80f7e2a99fdb 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -307,7 +307,7 @@ func (s *Server) streamPayloadAttributes(stream ethpbservice.Events_StreamEvents Data: ðpb.EventPayloadAttributeV2_BasePayloadAttribute{ ProposerIndex: headBlock.Block().ProposerIndex(), ProposalSlot: headState.Slot(), - ParentBlockNumber: headBlock.Block().Slot(), + ParentBlockNumber: headPayload.BlockNumber(), ParentBlockRoot: headRoot, ParentBlockHash: headPayload.BlockHash(), PayloadAttributesV2: &enginev1.PayloadAttributesV2{ diff --git a/beacon-chain/rpc/eth/events/events_test.go b/beacon-chain/rpc/eth/events/events_test.go index 5aa17496528f..0f713b2ad1f2 100644 --- a/beacon-chain/rpc/eth/events/events_test.go +++ b/beacon-chain/rpc/eth/events/events_test.go @@ -324,7 +324,6 @@ func TestStreamEvents_StateEvents(t *testing.T) { t.Run(PayloadAttributesTopic+"_bellatrix", func(t *testing.T) { ctx := context.Background() - params.SetupTestConfigCleanup(t) beaconState, _ := util.DeterministicGenesisStateBellatrix(t, 1) stateRoot, err := beaconState.HashTreeRoot(ctx) @@ -407,16 +406,7 @@ func TestStreamEvents_StateEvents(t *testing.T) { }) t.Run(PayloadAttributesTopic+"_capella", func(t *testing.T) { ctx := context.Background() - db := dbutil.SetupDB(t) - transition.SkipSlotCache.Disable() - - params.SetupTestConfigCleanup(t) - cfg := params.BeaconConfig().Copy() - cfg.CapellaForkEpoch = 3 - cfg.BellatrixForkEpoch = 2 - cfg.AltairForkEpoch = 1 - params.OverrideBeaconConfig(cfg) - beaconState, _ := util.DeterministicGenesisState(t, 64) + beaconState, _ := util.DeterministicGenesisStateCapella(t, 1) stateRoot, err := beaconState.HashTreeRoot(ctx) require.NoError(t, err, "Could not hash genesis state") @@ -424,18 +414,10 @@ func TestStreamEvents_StateEvents(t *testing.T) { genesis := b.NewGenesisBlock(stateRoot[:]) util.SaveBlock(t, ctx, db, genesis) - parentRoot, err := genesis.Block.HashTreeRoot() - require.NoError(t, err, "Could not get signing root") - require.NoError(t, db.SaveState(ctx, beaconState, parentRoot), "Could not save genesis state") - require.NoError(t, db.SaveHeadBlockRoot(ctx, parentRoot), "Could not save genesis state") - - capellaSlot, err := slots.EpochStart(params.BeaconConfig().CapellaForkEpoch) - require.NoError(t, err) - var scBits [fieldparams.SyncAggregateSyncCommitteeBytesLength]byte blk := ð.SignedBeaconBlockCapella{ Block: ð.BeaconBlockCapella{ - Slot: capellaSlot + 1, + Slot: 1, ParentRoot: parentRoot[:], StateRoot: genesis.Block.StateRoot, Body: ð.BeaconBlockBodyCapella{ From 32e60ecb85e1fbe5b94f8ae6586d3ecba21b9d08 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 14 Mar 2023 16:52:59 -0500 Subject: [PATCH 28/31] adding unit tests for stream --- .../cache/depositsnapshot/BUILD.bazel | 8 + beacon-chain/rpc/eth/events/BUILD.bazel | 7 + beacon-chain/rpc/eth/events/events_test.go | 149 +++++++++++------- 3 files changed, 106 insertions(+), 58 deletions(-) diff --git a/beacon-chain/cache/depositsnapshot/BUILD.bazel b/beacon-chain/cache/depositsnapshot/BUILD.bazel index 412a32e266bb..e7f1208336d0 100644 --- a/beacon-chain/cache/depositsnapshot/BUILD.bazel +++ b/beacon-chain/cache/depositsnapshot/BUILD.bazel @@ -5,7 +5,10 @@ go_library( srcs = [ "deposit_tree.go", "deposit_tree_snapshot.go", + "deposit_tree_snapshot_test 2.go", "merkle_tree.go", + "merkle_tree_test 2.go", + "spec_test 2.go", "zerohashes.gen.go", ], importpath = "github.com/prysmaticlabs/prysm/v3/beacon-chain/cache/depositsnapshot", @@ -14,9 +17,14 @@ go_library( "//container/slice:go_default_library", "//crypto/hash:go_default_library", "//encoding/bytesutil:go_default_library", + "//io/file:go_default_library", "//math:go_default_library", "//proto/eth/v1:go_default_library", + "//testing/assert:go_default_library", + "//testing/require:go_default_library", "@com_github_pkg_errors//:go_default_library", + "@in_gopkg_yaml_v3//:go_default_library", + "@io_bazel_rules_go//go/tools/bazel:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/events/BUILD.bazel b/beacon-chain/rpc/eth/events/BUILD.bazel index 9c62f2a6601b..8bcd1550dd09 100644 --- a/beacon-chain/rpc/eth/events/BUILD.bazel +++ b/beacon-chain/rpc/eth/events/BUILD.bazel @@ -39,18 +39,25 @@ go_test( deps = [ "//async/event:go_default_library", "//beacon-chain/blockchain/testing:go_default_library", + "//beacon-chain/core/blocks:go_default_library", "//beacon-chain/core/feed:go_default_library", "//beacon-chain/core/feed/block:go_default_library", "//beacon-chain/core/feed/operation:go_default_library", "//beacon-chain/core/feed/state:go_default_library", + "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/time:go_default_library", + "//config/fieldparams:go_default_library", "//consensus-types/blocks:go_default_library", + "//proto/engine/v1:go_default_library", "//proto/eth/v1:go_default_library", "//proto/migration:go_default_library", "//proto/prysm/v1alpha1:go_default_library", + "//runtime/version:go_default_library", "//testing/assert:go_default_library", "//testing/mock:go_default_library", "//testing/require:go_default_library", "//testing/util:go_default_library", + "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_golang_mock//gomock:go_default_library", "@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", diff --git a/beacon-chain/rpc/eth/events/events_test.go b/beacon-chain/rpc/eth/events/events_test.go index 0f713b2ad1f2..7c77825548d4 100644 --- a/beacon-chain/rpc/eth/events/events_test.go +++ b/beacon-chain/rpc/eth/events/events_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/golang/mock/gomock" "github.com/grpc-ecosystem/grpc-gateway/v2/proto/gateway" "github.com/prysmaticlabs/go-bitfield" @@ -15,10 +16,9 @@ import ( blockfeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/block" "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/operation" statefeed "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/feed/state" - "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/transition" - dbutil "github.com/prysmaticlabs/prysm/v3/beacon-chain/db/testing" + "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/helpers" + prysmtime "github.com/prysmaticlabs/prysm/v3/beacon-chain/core/time" fieldparams "github.com/prysmaticlabs/prysm/v3/config/fieldparams" - "github.com/prysmaticlabs/prysm/v3/config/params" "github.com/prysmaticlabs/prysm/v3/consensus-types/blocks" enginev1 "github.com/prysmaticlabs/prysm/v3/proto/engine/v1" ethpb "github.com/prysmaticlabs/prysm/v3/proto/eth/v1" @@ -29,7 +29,6 @@ import ( "github.com/prysmaticlabs/prysm/v3/testing/mock" "github.com/prysmaticlabs/prysm/v3/testing/require" "github.com/prysmaticlabs/prysm/v3/testing/util" - "github.com/prysmaticlabs/prysm/v3/time/slots" "google.golang.org/protobuf/types/known/anypb" ) @@ -287,45 +286,46 @@ func TestStreamEvents_OperationsEvents(t *testing.T) { } func TestStreamEvents_StateEvents(t *testing.T) { - //t.Run(HeadTopic, func(t *testing.T) { - // ctx := context.Background() - // srv, ctrl, mockStream := setupServer(ctx, t) - // defer ctrl.Finish() - // - // wantedHead := ðpb.EventHead{ - // Slot: 8, - // Block: make([]byte, 32), - // State: make([]byte, 32), - // EpochTransition: true, - // PreviousDutyDependentRoot: make([]byte, 32), - // CurrentDutyDependentRoot: make([]byte, 32), - // ExecutionOptimistic: true, - // } - // genericResponse, err := anypb.New(wantedHead) - // require.NoError(t, err) - // wantedMessage := &gateway.EventSource{ - // Event: HeadTopic, - // Data: genericResponse, - // } - // - // assertFeedSendAndReceive(ctx, &assertFeedArgs{ - // t: t, - // srv: srv, - // topics: []string{HeadTopic}, - // stream: mockStream, - // shouldReceive: wantedMessage, - // itemToSend: &feed.Event{ - // Type: statefeed.NewHead, - // Data: wantedHead, - // }, - // feed: srv.StateNotifier.StateFeed(), - // }) - //}) + t.Run(HeadTopic, func(t *testing.T) { + ctx := context.Background() + srv, ctrl, mockStream := setupServer(ctx, t) + defer ctrl.Finish() + + wantedHead := ðpb.EventHead{ + Slot: 8, + Block: make([]byte, 32), + State: make([]byte, 32), + EpochTransition: true, + PreviousDutyDependentRoot: make([]byte, 32), + CurrentDutyDependentRoot: make([]byte, 32), + ExecutionOptimistic: true, + } + genericResponse, err := anypb.New(wantedHead) + require.NoError(t, err) + wantedMessage := &gateway.EventSource{ + Event: HeadTopic, + Data: genericResponse, + } + + assertFeedSendAndReceive(ctx, &assertFeedArgs{ + t: t, + srv: srv, + topics: []string{HeadTopic}, + stream: mockStream, + shouldReceive: wantedMessage, + itemToSend: &feed.Event{ + Type: statefeed.NewHead, + Data: wantedHead, + }, + feed: srv.StateNotifier.StateFeed(), + }) + }) t.Run(PayloadAttributesTopic+"_bellatrix", func(t *testing.T) { ctx := context.Background() beaconState, _ := util.DeterministicGenesisStateBellatrix(t, 1) - + err := beaconState.SetSlot(2) + require.NoError(t, err, "Count not set slot") stateRoot, err := beaconState.HashTreeRoot(ctx) require.NoError(t, err, "Could not hash genesis state") @@ -337,15 +337,17 @@ func TestStreamEvents_StateEvents(t *testing.T) { var scBits [fieldparams.SyncAggregateSyncCommitteeBytesLength]byte blk := ð.SignedBeaconBlockBellatrix{ Block: ð.BeaconBlockBellatrix{ - Slot: 1, - ParentRoot: parentRoot[:], - StateRoot: genesis.Block.StateRoot, + ProposerIndex: 1, + Slot: 1, + ParentRoot: parentRoot[:], + StateRoot: genesis.Block.StateRoot, Body: ð.BeaconBlockBodyBellatrix{ RandaoReveal: genesis.Block.Body.RandaoReveal, Graffiti: genesis.Block.Body.Graffiti, Eth1Data: genesis.Block.Body.Eth1Data, SyncAggregate: ð.SyncAggregate{SyncCommitteeBits: scBits[:], SyncCommitteeSignature: make([]byte, 96)}, ExecutionPayload: &enginev1.ExecutionPayload{ + BlockNumber: 1, ParentHash: make([]byte, fieldparams.RootLength), FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), StateRoot: make([]byte, fieldparams.RootLength), @@ -360,15 +362,20 @@ func TestStreamEvents_StateEvents(t *testing.T) { Signature: genesis.Signature, } signedBlk, err := blocks.NewSignedBeaconBlock(blk) + require.NoError(t, err) srv, ctrl, mockStream := setupServer(ctx, t) defer ctrl.Finish() srv.HeadFetcher = &mockChain.ChainService{ Genesis: time.Now(), State: beaconState, Block: signedBlk, - Root: []byte("hello-world"), + Root: make([]byte, 32), ValidatorsRoot: [32]byte{}, } + + prevRando, err := helpers.RandaoMix(beaconState, prysmtime.CurrentEpoch(beaconState)) + require.NoError(t, err) + wantedPayload := ðpb.EventPayloadAttributeV1{ Version: version.String(version.Bellatrix), Data: ðpb.EventPayloadAttributeV1_BasePayloadAttribute{ @@ -378,8 +385,8 @@ func TestStreamEvents_StateEvents(t *testing.T) { ParentBlockRoot: make([]byte, 32), ParentBlockHash: make([]byte, 32), PayloadAttributes: &enginev1.PayloadAttributes{ - Timestamp: uint64(time.Now().Unix()), - PrevRandao: make([]byte, 32), + Timestamp: 24, + PrevRandao: prevRando, SuggestedFeeRecipient: make([]byte, 20), }, }, @@ -407,25 +414,44 @@ func TestStreamEvents_StateEvents(t *testing.T) { t.Run(PayloadAttributesTopic+"_capella", func(t *testing.T) { ctx := context.Background() beaconState, _ := util.DeterministicGenesisStateCapella(t, 1) - + validator, err := beaconState.ValidatorAtIndex(0) + require.NoError(t, err, "Could not get validator") + by, err := hexutil.Decode("0x010000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b") + require.NoError(t, err) + validator.WithdrawalCredentials = by + err = beaconState.UpdateValidatorAtIndex(0, validator) + require.NoError(t, err) + err = beaconState.SetSlot(2) + require.NoError(t, err, "Count not set slot") + err = beaconState.SetNextWithdrawalValidatorIndex(0) + require.NoError(t, err, "Could not set withdrawal index") + err = beaconState.SetBalances([]uint64{33000000000}) + require.NoError(t, err, "Could not set validator balance") stateRoot, err := beaconState.HashTreeRoot(ctx) require.NoError(t, err, "Could not hash genesis state") genesis := b.NewGenesisBlock(stateRoot[:]) - util.SaveBlock(t, ctx, db, genesis) + parentRoot, err := genesis.Block.HashTreeRoot() + require.NoError(t, err, "Could not get signing root") + + withdrawals, err := beaconState.ExpectedWithdrawals() + require.NoError(t, err, "Could get expected withdrawals") + require.NotEqual(t, len(withdrawals), 0) var scBits [fieldparams.SyncAggregateSyncCommitteeBytesLength]byte blk := ð.SignedBeaconBlockCapella{ Block: ð.BeaconBlockCapella{ - Slot: 1, - ParentRoot: parentRoot[:], - StateRoot: genesis.Block.StateRoot, + ProposerIndex: 1, + Slot: 1, + ParentRoot: parentRoot[:], + StateRoot: genesis.Block.StateRoot, Body: ð.BeaconBlockBodyCapella{ RandaoReveal: genesis.Block.Body.RandaoReveal, Graffiti: genesis.Block.Body.Graffiti, Eth1Data: genesis.Block.Body.Eth1Data, SyncAggregate: ð.SyncAggregate{SyncCommitteeBits: scBits[:], SyncCommitteeSignature: make([]byte, 96)}, ExecutionPayload: &enginev1.ExecutionPayloadCapella{ + BlockNumber: 1, ParentHash: make([]byte, fieldparams.RootLength), FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), StateRoot: make([]byte, fieldparams.RootLength), @@ -434,19 +460,26 @@ func TestStreamEvents_StateEvents(t *testing.T) { PrevRandao: make([]byte, fieldparams.RootLength), BaseFeePerGas: make([]byte, fieldparams.RootLength), BlockHash: make([]byte, fieldparams.RootLength), + Withdrawals: withdrawals, }, }, }, Signature: genesis.Signature, } - - blkRoot, err := blk.Block.HashTreeRoot() + signedBlk, err := blocks.NewSignedBeaconBlock(blk) require.NoError(t, err) - require.NoError(t, err, "Could not get signing root") - require.NoError(t, db.SaveState(ctx, beaconState, blkRoot), "Could not save genesis state") - require.NoError(t, db.SaveHeadBlockRoot(ctx, blkRoot), "Could not save genesis state") srv, ctrl, mockStream := setupServer(ctx, t) defer ctrl.Finish() + srv.HeadFetcher = &mockChain.ChainService{ + Genesis: time.Now(), + State: beaconState, + Block: signedBlk, + Root: make([]byte, 32), + ValidatorsRoot: [32]byte{}, + } + + prevRando, err := helpers.RandaoMix(beaconState, prysmtime.CurrentEpoch(beaconState)) + require.NoError(t, err) wantedPayload := ðpb.EventPayloadAttributeV2{ Version: version.String(version.Capella), @@ -457,10 +490,10 @@ func TestStreamEvents_StateEvents(t *testing.T) { ParentBlockRoot: make([]byte, 32), ParentBlockHash: make([]byte, 32), PayloadAttributesV2: &enginev1.PayloadAttributesV2{ - Timestamp: uint64(time.Now().Unix()), - PrevRandao: make([]byte, 32), + Timestamp: 24, + PrevRandao: prevRando, SuggestedFeeRecipient: make([]byte, 20), - Withdrawals: make([]*enginev1.Withdrawal, 1), + Withdrawals: withdrawals, }, }, } From 9c1fa07d760ef8cc467f406abeafb19bbf056e39 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 14 Mar 2023 16:57:35 -0500 Subject: [PATCH 29/31] updating items based on review --- beacon-chain/blockchain/execution_engine.go | 2 ++ beacon-chain/rpc/eth/events/events.go | 3 ++- proto/eth/v1/events.proto | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/beacon-chain/blockchain/execution_engine.go b/beacon-chain/blockchain/execution_engine.go index f0b6311858e1..1a310b78188e 100644 --- a/beacon-chain/blockchain/execution_engine.go +++ b/beacon-chain/blockchain/execution_engine.go @@ -70,6 +70,7 @@ func (s *Service) notifyForkchoiceUpdate(ctx context.Context, arg *notifyForkcho nextSlot := s.CurrentSlot() + 1 // Cache payload ID for next slot proposer. hasAttr, attr, proposerId := s.getPayloadAttribute(ctx, arg.headState, nextSlot) + payloadID, lastValidHash, err := s.cfg.ExecutionEngineCaller.ForkchoiceUpdated(ctx, fcs, attr) if err != nil { switch err { @@ -256,6 +257,7 @@ func (s *Service) getPayloadAttribute(ctx context.Context, st state.BeaconState, if !ok { // There's no need to build attribute if there is no proposer for slot. return false, emptyAttri, 0 } + // Get previous randao. st = st.Copy() st, err := transition.ProcessSlotsIfPossible(ctx, st, slot) diff --git a/beacon-chain/rpc/eth/events/events.go b/beacon-chain/rpc/eth/events/events.go index 80f7e2a99fdb..3fb37a4aca7e 100644 --- a/beacon-chain/rpc/eth/events/events.go +++ b/beacon-chain/rpc/eth/events/events.go @@ -248,7 +248,8 @@ func (s *Server) handleStateEvents( } } -// notifyPayloadAttributesStream on successful FCU notify the event stream that a payload was sent +// streamPayloadAttributes on new head event. +// This event stream is intended to be used by builders and relays. func (s *Server) streamPayloadAttributes(stream ethpbservice.Events_StreamEventsServer) error { headState, err := s.HeadFetcher.HeadStateReadOnly(s.Ctx) if err != nil { diff --git a/proto/eth/v1/events.proto b/proto/eth/v1/events.proto index 3095fa06df2a..df48ddb6f9ce 100644 --- a/proto/eth/v1/events.proto +++ b/proto/eth/v1/events.proto @@ -114,7 +114,7 @@ message EventPayloadAttributeV1 { // The slot at which a block using these payload attributes may be built. uint64 proposal_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; - // The execution block number of the parent block, which is also the Slot number. + // The execution block number of the parent block. uint64 parent_block_number = 4; // The beacon block root of the parent block to be built upon. @@ -143,7 +143,7 @@ message EventPayloadAttributeV2 { // The slot at which a block using these payload attributes may be built. uint64 proposal_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"]; - // The execution block number of the parent block, which is also the Slot number. + // The execution block number of the parent block. uint64 parent_block_number = 4; // The beacon block root of the parent block to be built upon. From c1ac157e853570652bb59033fdbd215c14e346fa Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 14 Mar 2023 17:05:15 -0500 Subject: [PATCH 30/31] fixing linting --- beacon-chain/cache/depositsnapshot/BUILD.bazel | 8 -------- 1 file changed, 8 deletions(-) diff --git a/beacon-chain/cache/depositsnapshot/BUILD.bazel b/beacon-chain/cache/depositsnapshot/BUILD.bazel index e7f1208336d0..412a32e266bb 100644 --- a/beacon-chain/cache/depositsnapshot/BUILD.bazel +++ b/beacon-chain/cache/depositsnapshot/BUILD.bazel @@ -5,10 +5,7 @@ go_library( srcs = [ "deposit_tree.go", "deposit_tree_snapshot.go", - "deposit_tree_snapshot_test 2.go", "merkle_tree.go", - "merkle_tree_test 2.go", - "spec_test 2.go", "zerohashes.gen.go", ], importpath = "github.com/prysmaticlabs/prysm/v3/beacon-chain/cache/depositsnapshot", @@ -17,14 +14,9 @@ go_library( "//container/slice:go_default_library", "//crypto/hash:go_default_library", "//encoding/bytesutil:go_default_library", - "//io/file:go_default_library", "//math:go_default_library", "//proto/eth/v1:go_default_library", - "//testing/assert:go_default_library", - "//testing/require:go_default_library", "@com_github_pkg_errors//:go_default_library", - "@in_gopkg_yaml_v3//:go_default_library", - "@io_bazel_rules_go//go/tools/bazel:go_default_library", ], ) From 346ba0f4135147bf4b874e2c3a16d5252792aabe Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 14 Mar 2023 17:07:03 -0500 Subject: [PATCH 31/31] removing extra line --- cmd/beacon-chain/flags/base.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index 5be5132af64c..76d5154eaf09 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -103,7 +103,6 @@ var ( Name: "disable-grpc-gateway", Usage: "Disable the gRPC gateway for JSON-HTTP requests", } - // GRPCGatewayHost specifies a gRPC gateway host for Prysm. GRPCGatewayHost = &cli.StringFlag{ Name: "grpc-gateway-host",