HTTP handler for Beacon API events (#13207)

* in progress

* implementation done

* bzl

* fixes

* tests in progress

* tests

* go mod tidy

* Update beacon-chain/rpc/eth/events/events.go

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>

* fix config test

* fix unreachable code issue

* remove proto service dir

* test fix

---------

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
This commit is contained in:
Radosław Kapka 2023-11-29 00:20:02 +01:00 committed by GitHub
parent 52f1b3f958
commit 6a638bd148
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 826 additions and 4378 deletions

View File

@ -8,7 +8,6 @@ go_library(
deps = [
"//api/gateway:go_default_library",
"//cmd/beacon-chain/flags:go_default_library",
"//proto/eth/service:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library",
"@org_golang_google_protobuf//encoding/protojson:go_default_library",

View File

@ -4,7 +4,6 @@ import (
gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/prysmaticlabs/prysm/v4/api/gateway"
"github.com/prysmaticlabs/prysm/v4/cmd/beacon-chain/flags"
ethpbservice "github.com/prysmaticlabs/prysm/v4/proto/eth/service"
ethpbalpha "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
"google.golang.org/protobuf/encoding/protojson"
)
@ -51,9 +50,7 @@ func DefaultConfig(enableDebugRPCEndpoints bool, httpModules string) MuxConfig {
}
}
if flags.EnableHTTPEthAPI(httpModules) {
ethRegistrations := []gateway.PbHandlerRegistration{
ethpbservice.RegisterEventsHandler,
}
ethRegistrations := []gateway.PbHandlerRegistration{}
ethMux := gwruntime.NewServeMux(
gwruntime.WithMarshalerOption(gwruntime.MIMEWildcard, &gwruntime.HTTPBodyMarshaler{
Marshaler: &gwruntime.JSONPb{

View File

@ -14,7 +14,7 @@ func TestDefaultConfig(t *testing.T) {
assert.NotNil(t, cfg.EthPbMux.Mux)
require.Equal(t, 2, len(cfg.EthPbMux.Patterns))
assert.Equal(t, "/internal/eth/v1/", cfg.EthPbMux.Patterns[0])
assert.Equal(t, 1, len(cfg.EthPbMux.Registrations))
assert.Equal(t, 0, len(cfg.EthPbMux.Registrations))
assert.Equal(t, (*gateway.PbMux)(nil), cfg.V1AlphaPbMux)
})
t.Run("Without Eth API", func(t *testing.T) {

View File

@ -51,7 +51,6 @@ go_library(
"//config/params:go_default_library",
"//io/logs:go_default_library",
"//monitoring/tracing:go_default_library",
"//proto/eth/service:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"@com_github_gorilla_mux//:go_default_library",
"@com_github_grpc_ecosystem_go_grpc_middleware//:go_default_library",

View File

@ -3,7 +3,6 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = [
"custom_handlers.go",
"custom_hooks.go",
"endpoint_factory.go",
"structs.go",
@ -13,20 +12,16 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//api/gateway/apimiddleware:go_default_library",
"//beacon-chain/rpc/eth/events:go_default_library",
"//config/params:go_default_library",
"//consensus-types/primitives:go_default_library",
"//runtime/version:go_default_library",
"//time/slots:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_r3labs_sse_v2//:go_default_library",
],
)
go_test(
name = "go_default_test",
srcs = [
"custom_handlers_test.go",
"custom_hooks_test.go",
"endpoint_factory_test.go",
"structs_marshalling_test.go",
@ -34,11 +29,9 @@ go_test(
embed = [":go_default_library"],
deps = [
"//api/gateway/apimiddleware:go_default_library",
"//beacon-chain/rpc/eth/events:go_default_library",
"//config/params:go_default_library",
"//testing/assert:go_default_library",
"//testing/require:go_default_library",
"//time/slots:go_default_library",
"@com_github_r3labs_sse_v2//:go_default_library",
],
)

View File

@ -1,173 +0,0 @@
package apimiddleware
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"net/http"
"github.com/prysmaticlabs/prysm/v4/api/gateway/apimiddleware"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/events"
"github.com/prysmaticlabs/prysm/v4/runtime/version"
"github.com/r3labs/sse/v2"
)
func handleEvents(m *apimiddleware.ApiProxyMiddleware, _ apimiddleware.Endpoint, w http.ResponseWriter, req *http.Request) (handled bool) {
sseClient := sse.NewClient("http://" + m.GatewayAddress + "/internal" + req.URL.RequestURI())
sseClient.Headers["Grpc-Timeout"] = "0S"
eventChan := make(chan *sse.Event)
// We use grpc-gateway as the server side of events, not the sse library.
// Because of this subscribing to streams doesn't work as intended, resulting in each event being handled by all subscriptions.
// To handle events properly, we subscribe just once using a placeholder value ('events') and handle all topics inside this subscription.
if err := sseClient.SubscribeChan("events", eventChan); err != nil {
apimiddleware.WriteError(w, apimiddleware.InternalServerError(err), nil)
sseClient.Unsubscribe(eventChan)
return
}
errJson := receiveEvents(eventChan, w, req)
if errJson != nil {
apimiddleware.WriteError(w, errJson, nil)
}
sseClient.Unsubscribe(eventChan)
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 {
case msg := <-eventChan:
var data interface{}
// The message's event comes to us with trailing whitespace. Remove it here for
// ease of future processing.
msg.Event = bytes.TrimSpace(msg.Event)
switch string(msg.Event) {
case events.HeadTopic:
data = &EventHeadJson{}
case events.BlockTopic:
data = &ReceivedBlockDataJson{}
case events.AttestationTopic:
data = &AttestationJson{}
// Data received in the aggregated att event does not fit the expected event stream output.
// We extract the underlying attestation from event data
// and assign the attestation back to event data for further processing.
aggEventData := &AggregatedAttReceivedDataJson{}
if err := json.Unmarshal(msg.Data, aggEventData); err != nil {
return apimiddleware.InternalServerError(err)
}
var attData []byte
var err error
// If true, then we have an unaggregated attestation
if aggEventData.Aggregate == nil {
unaggEventData := &UnaggregatedAttReceivedDataJson{}
if err := json.Unmarshal(msg.Data, unaggEventData); err != nil {
return apimiddleware.InternalServerError(err)
}
attData, err = json.Marshal(unaggEventData)
if err != nil {
return apimiddleware.InternalServerError(err)
}
} else {
attData, err = json.Marshal(aggEventData.Aggregate)
if err != nil {
return apimiddleware.InternalServerError(err)
}
}
msg.Data = attData
case events.VoluntaryExitTopic:
data = &SignedVoluntaryExitJson{}
case events.FinalizedCheckpointTopic:
data = &EventFinalizedCheckpointJson{}
case events.ChainReorgTopic:
data = &EventChainReorgJson{}
case events.SyncCommitteeContributionTopic:
data = &SignedContributionAndProofJson{}
case events.BLSToExecutionChangeTopic:
data = &SignedBLSToExecutionChangeJson{}
case events.PayloadAttributesTopic:
dataSubset := &dataSubset{}
if err := json.Unmarshal(msg.Data, dataSubset); err != nil {
return apimiddleware.InternalServerError(err)
}
switch dataSubset.Version {
case version.String(version.Capella):
data = &EventPayloadAttributeStreamV2Json{}
case version.String(version.Bellatrix):
data = &EventPayloadAttributeStreamV1Json{}
default:
return apimiddleware.InternalServerError(errors.New("payload version unsupported"))
}
case events.BlobSidecarTopic:
data = &EventBlobSidecarJson{}
case "error":
data = &EventErrorJson{}
default:
return &apimiddleware.DefaultErrorJson{
Message: fmt.Sprintf("Event type '%s' not supported", string(msg.Event)),
Code: http.StatusInternalServerError,
}
}
if errJson := writeEvent(msg, w, data); errJson != nil {
return errJson
}
if errJson := flushEvent(w); errJson != nil {
return errJson
}
case <-req.Context().Done():
return nil
}
}
}
func writeEvent(msg *sse.Event, w http.ResponseWriter, data interface{}) apimiddleware.ErrorJson {
if err := json.Unmarshal(msg.Data, data); err != nil {
return apimiddleware.InternalServerError(err)
}
if errJson := apimiddleware.ProcessMiddlewareResponseFields(data); errJson != nil {
return errJson
}
dataJson, errJson := apimiddleware.SerializeMiddlewareResponseIntoJson(data)
if errJson != nil {
return errJson
}
w.Header().Set("Content-Type", "text/event-stream")
if _, err := w.Write([]byte("event: ")); err != nil {
return apimiddleware.InternalServerError(err)
}
if _, err := w.Write(msg.Event); err != nil {
return apimiddleware.InternalServerError(err)
}
if _, err := w.Write([]byte("\ndata: ")); err != nil {
return apimiddleware.InternalServerError(err)
}
if _, err := w.Write(dataJson); err != nil {
return apimiddleware.InternalServerError(err)
}
if _, err := w.Write([]byte("\n\n")); err != nil {
return apimiddleware.InternalServerError(err)
}
return nil
}
func flushEvent(w http.ResponseWriter) apimiddleware.ErrorJson {
flusher, ok := w.(http.Flusher)
if !ok {
return &apimiddleware.DefaultErrorJson{Message: fmt.Sprintf("Flush not supported in %T", w), Code: http.StatusInternalServerError}
}
flusher.Flush()
return nil
}

View File

@ -1,212 +0,0 @@
package apimiddleware
import (
"bytes"
"context"
"encoding/json"
"net/http/httptest"
"testing"
"time"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/events"
"github.com/prysmaticlabs/prysm/v4/testing/assert"
"github.com/prysmaticlabs/prysm/v4/testing/require"
"github.com/r3labs/sse/v2"
)
func TestReceiveEvents(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
ch := make(chan *sse.Event)
w := httptest.NewRecorder()
w.Body = &bytes.Buffer{}
req := httptest.NewRequest("GET", "http://foo.example", &bytes.Buffer{})
req = req.WithContext(ctx)
go func() {
base64Val := "Zm9v"
data := &EventFinalizedCheckpointJson{
Block: base64Val,
State: base64Val,
Epoch: "1",
}
bData, err := json.Marshal(data)
require.NoError(t, err)
msg := &sse.Event{
Data: bData,
Event: []byte(events.FinalizedCheckpointTopic),
}
ch <- msg
time.Sleep(time.Second)
cancel()
}()
errJson := receiveEvents(ch, w, req)
assert.Equal(t, true, errJson == nil)
expectedEvent := `event: finalized_checkpoint
data: {"block":"0x666f6f","state":"0x666f6f","epoch":"1","execution_optimistic":false}
`
assert.DeepEqual(t, expectedEvent, w.Body.String())
}
func TestReceiveEvents_AggregatedAtt(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
ch := make(chan *sse.Event)
w := httptest.NewRecorder()
w.Body = &bytes.Buffer{}
req := httptest.NewRequest("GET", "http://foo.example", &bytes.Buffer{})
req = req.WithContext(ctx)
go func() {
base64Val := "Zm9v"
data := AggregatedAttReceivedDataJson{
Aggregate: &AttestationJson{
AggregationBits: base64Val,
Data: &AttestationDataJson{
Slot: "1",
CommitteeIndex: "1",
BeaconBlockRoot: base64Val,
Source: nil,
Target: nil,
},
Signature: base64Val,
},
}
bData, err := json.Marshal(data)
require.NoError(t, err)
msg := &sse.Event{
Data: bData,
Event: []byte(events.AttestationTopic),
}
ch <- msg
time.Sleep(time.Second)
cancel()
}()
errJson := receiveEvents(ch, w, req)
assert.Equal(t, true, errJson == nil)
expectedEvent := `event: attestation
data: {"aggregation_bits":"0x666f6f","data":{"slot":"1","index":"1","beacon_block_root":"0x666f6f","source":null,"target":null},"signature":"0x666f6f"}
`
assert.DeepEqual(t, expectedEvent, w.Body.String())
}
func TestReceiveEvents_UnaggregatedAtt(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
ch := make(chan *sse.Event)
w := httptest.NewRecorder()
w.Body = &bytes.Buffer{}
req := httptest.NewRequest("GET", "http://foo.example", &bytes.Buffer{})
req = req.WithContext(ctx)
go func() {
base64Val := "Zm9v"
data := UnaggregatedAttReceivedDataJson{
AggregationBits: base64Val,
Data: &AttestationDataJson{
Slot: "1",
CommitteeIndex: "1",
BeaconBlockRoot: base64Val,
Source: nil,
Target: nil,
},
Signature: base64Val,
}
bData, err := json.Marshal(data)
require.NoError(t, err)
msg := &sse.Event{
Data: bData,
Event: []byte(events.AttestationTopic),
}
ch <- msg
time.Sleep(time.Second)
cancel()
}()
errJson := receiveEvents(ch, w, req)
assert.Equal(t, true, errJson == nil)
expectedEvent := `event: attestation
data: {"aggregation_bits":"0x666f6f","data":{"slot":"1","index":"1","beacon_block_root":"0x666f6f","source":null,"target":null},"signature":"0x666f6f"}
`
assert.DeepEqual(t, expectedEvent, w.Body.String())
}
func TestReceiveEvents_EventNotSupported(t *testing.T) {
ch := make(chan *sse.Event)
w := httptest.NewRecorder()
w.Body = &bytes.Buffer{}
req := httptest.NewRequest("GET", "http://foo.example", &bytes.Buffer{})
go func() {
msg := &sse.Event{
Data: []byte("foo"),
Event: []byte("not_supported"),
}
ch <- msg
}()
errJson := receiveEvents(ch, w, req)
require.NotNil(t, errJson)
assert.Equal(t, "Event type 'not_supported' not supported", errJson.Msg())
}
func TestReceiveEvents_TrailingSpace(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
ch := make(chan *sse.Event)
w := httptest.NewRecorder()
w.Body = &bytes.Buffer{}
req := httptest.NewRequest("GET", "http://foo.example", &bytes.Buffer{})
req = req.WithContext(ctx)
go func() {
base64Val := "Zm9v"
data := &EventFinalizedCheckpointJson{
Block: base64Val,
State: base64Val,
Epoch: "1",
}
bData, err := json.Marshal(data)
require.NoError(t, err)
msg := &sse.Event{
Data: bData,
Event: []byte("finalized_checkpoint "),
}
ch <- msg
time.Sleep(time.Second)
cancel()
}()
errJson := receiveEvents(ch, w, req)
assert.Equal(t, true, errJson == nil)
assert.Equal(t, `event: finalized_checkpoint
data: {"block":"0x666f6f","state":"0x666f6f","epoch":"1","execution_optimistic":false}
`, w.Body.String())
}
func TestWriteEvent(t *testing.T) {
base64Val := "Zm9v"
data := &EventFinalizedCheckpointJson{
Block: base64Val,
State: base64Val,
Epoch: "1",
}
bData, err := json.Marshal(data)
require.NoError(t, err)
msg := &sse.Event{
Data: bData,
Event: []byte("test_event"),
}
w := httptest.NewRecorder()
w.Body = &bytes.Buffer{}
errJson := writeEvent(msg, w, &EventFinalizedCheckpointJson{})
require.Equal(t, true, errJson == nil)
written := w.Body.String()
assert.Equal(t, "event: test_event\ndata: {\"block\":\"0x666f6f\",\"state\":\"0x666f6f\",\"epoch\":\"1\",\"execution_optimistic\":false}\n\n", written)
}

View File

@ -1,7 +1,6 @@
package apimiddleware
import (
"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/v4/api/gateway/apimiddleware"
)
@ -15,21 +14,12 @@ func (f *BeaconEndpointFactory) IsNil() bool {
// Paths is a collection of all valid beacon chain API paths.
func (_ *BeaconEndpointFactory) Paths() []string {
return []string{
"/eth/v1/events",
}
return []string{}
}
// Create returns a new endpoint for the provided API path.
func (_ *BeaconEndpointFactory) Create(path string) (*apimiddleware.Endpoint, error) {
endpoint := apimiddleware.DefaultEndpoint()
switch path {
case "/eth/v1/events":
endpoint.CustomHandlers = []apimiddleware.CustomHandler{handleEvents}
default:
return nil, errors.New("invalid path")
}
endpoint.Path = path
return &endpoint, nil
}

View File

@ -651,103 +651,6 @@ type SszResponse interface {
SSZFinalized() bool
}
// ---------------
// Events.
// ---------------
type EventHeadJson struct {
Slot string `json:"slot"`
Block string `json:"block" hex:"true"`
State string `json:"state" hex:"true"`
EpochTransition bool `json:"epoch_transition"`
ExecutionOptimistic bool `json:"execution_optimistic"`
PreviousDutyDependentRoot string `json:"previous_duty_dependent_root" hex:"true"`
CurrentDutyDependentRoot string `json:"current_duty_dependent_root" hex:"true"`
}
type ReceivedBlockDataJson struct {
Slot string `json:"slot"`
Block string `json:"block" hex:"true"`
ExecutionOptimistic bool `json:"execution_optimistic"`
}
type AggregatedAttReceivedDataJson struct {
Aggregate *AttestationJson `json:"aggregate"`
}
type UnaggregatedAttReceivedDataJson struct {
AggregationBits string `json:"aggregation_bits" hex:"true"`
Data *AttestationDataJson `json:"data"`
Signature string `json:"signature" hex:"true"`
}
type EventFinalizedCheckpointJson struct {
Block string `json:"block" hex:"true"`
State string `json:"state" hex:"true"`
Epoch string `json:"epoch"`
ExecutionOptimistic bool `json:"execution_optimistic"`
}
type EventChainReorgJson struct {
Slot string `json:"slot"`
Depth string `json:"depth"`
OldHeadBlock string `json:"old_head_block" hex:"true"`
NewHeadBlock string `json:"old_head_state" hex:"true"`
OldHeadState string `json:"new_head_block" hex:"true"`
NewHeadState string `json:"new_head_state" hex:"true"`
Epoch string `json:"epoch"`
ExecutionOptimistic bool `json:"execution_optimistic"`
}
type EventPayloadAttributeStreamV1Json struct {
Version string `json:"version"`
Data *EventPayloadAttributeV1Json
}
type EventPayloadAttributeStreamV2Json struct {
Version string `json:"version"`
Data *EventPayloadAttributeV2Json `json:"data"`
}
type EventPayloadAttributeV1Json 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"`
PayloadAttributes *PayloadAttributesV1Json `json:"payload_attributes"`
}
type EventPayloadAttributeV2Json 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"`
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 {
Timestamp string `json:"timestamp"`
Random string `json:"prev_randao" hex:"true"`
SuggestedFeeRecipient string `json:"suggested_fee_recipient" hex:"true"`
Withdrawals []*WithdrawalJson `json:"withdrawals"`
}
type EventBlobSidecarJson struct {
BlockRoot string `json:"block_root" hex:"true"`
Index string `json:"index"`
Slot string `json:"slot"`
KzgCommitment string `json:"kzg_commitment" hex:"true"`
VersionedHash string `json:"versioned_hash" hex:"true"`
}
// ---------------
// Error handling.
// ---------------
@ -763,8 +666,3 @@ type SingleIndexedVerificationFailureJson struct {
Index int `json:"index"`
Message string `json:"message"`
}
type EventErrorJson struct {
StatusCode int `json:"status_code"`
Message string `json:"message"`
}

View File

@ -5,6 +5,7 @@ go_library(
srcs = [
"events.go",
"server.go",
"structs.go",
],
importpath = "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/events",
visibility = ["//beacon-chain:__subpackages__"],
@ -16,20 +17,14 @@ go_library(
"//beacon-chain/core/helpers:go_default_library",
"//beacon-chain/core/time:go_default_library",
"//beacon-chain/core/transition:go_default_library",
"//encoding/bytesutil:go_default_library",
"//proto/engine/v1:go_default_library",
"//proto/eth/service:go_default_library",
"//beacon-chain/rpc/eth/shared:go_default_library",
"//network/http: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_ethereum_go_ethereum//common/hexutil: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",
"@org_golang_google_protobuf//types/known/anypb:go_default_library",
"@io_opencensus_go//trace:go_default_library",
],
)
@ -38,31 +33,18 @@ go_test(
srcs = ["events_test.go"],
embed = [":go_default_library"],
deps = [
"//async/event:go_default_library",
"//beacon-chain/blockchain: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/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",
"//beacon-chain/state:go_default_library",
"//consensus-types/blocks:go_default_library",
"//encoding/bytesutil:go_default_library",
"//proto/engine/v1:go_default_library",
"//consensus-types/interfaces:go_default_library",
"//consensus-types/primitives: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",
"@org_golang_google_protobuf//types/known/anypb:go_default_library",
],
)

View File

@ -1,10 +1,12 @@
package events
import (
"strings"
"context"
"encoding/json"
"fmt"
"net/http"
gwpb "github.com/grpc-ecosystem/grpc-gateway/v2/proto/gateway"
"github.com/pkg/errors"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/core/feed"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/core/feed/operation"
@ -12,18 +14,13 @@ import (
"github.com/prysmaticlabs/prysm/v4/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/core/time"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/core/transition"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
enginev1 "github.com/prysmaticlabs/prysm/v4/proto/engine/v1"
ethpbservice "github.com/prysmaticlabs/prysm/v4/proto/eth/service"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared"
http2 "github.com/prysmaticlabs/prysm/v4/network/http"
ethpb "github.com/prysmaticlabs/prysm/v4/proto/eth/v1"
"github.com/prysmaticlabs/prysm/v4/proto/migration"
"github.com/prysmaticlabs/prysm/v4/runtime/version"
"github.com/prysmaticlabs/prysm/v4/time/slots"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/anypb"
"go.opencensus.io/trace"
)
const (
@ -49,6 +46,8 @@ const (
BlobSidecarTopic = "blob_sidecar"
)
const topicDataMismatch = "Event data type %T does not correspond to event topic %s"
var casesHandled = map[string]bool{
HeadTopic: true,
BlockTopic: true,
@ -62,300 +61,357 @@ var casesHandled = map[string]bool{
BlobSidecarTopic: true,
}
// StreamEvents allows requesting all events from a set of topics defined in the Ethereum consensus API standard.
// The topics supported include block events, attestations, chain reorgs, voluntary exits,
// chain finality, and more.
func (s *Server) StreamEvents(
req *ethpb.StreamEventsRequest, stream ethpbservice.Events_StreamEventsServer,
) error {
if req == nil || len(req.Topics) == 0 {
return status.Error(codes.InvalidArgument, "No topics specified to subscribe to")
// StreamEvents provides an endpoint to subscribe to the beacon node Server-Sent-Events stream.
// Consumers should use the eventsource implementation to listen for those events.
// Servers may send SSE comments beginning with ':' for any purpose,
// including to keep the event stream connection alive in the presence of proxy servers.
func (s *Server) StreamEvents(w http.ResponseWriter, r *http.Request) {
ctx, span := trace.StartSpan(r.Context(), "events.StreamEvents")
defer span.End()
flusher, ok := w.(http.Flusher)
if !ok {
http2.HandleError(w, "Streaming unsupported!", http.StatusInternalServerError)
return
}
// Check if the topics in the request are valid.
requestedTopics := make(map[string]bool)
for _, rawTopic := range req.Topics {
splitTopic := strings.Split(rawTopic, ",")
for _, topic := range splitTopic {
if _, ok := casesHandled[topic]; !ok {
return status.Errorf(codes.InvalidArgument, "Topic %s not allowed for event subscriptions", topic)
}
requestedTopics[topic] = true
topics := r.URL.Query()["topics"]
if len(topics) == 0 {
http2.HandleError(w, "No topics specified to subscribe to", http.StatusBadRequest)
return
}
topicsMap := make(map[string]bool)
for _, topic := range topics {
if _, ok := casesHandled[topic]; !ok {
http2.HandleError(w, fmt.Sprintf("Invalid topic: %s", topic), http.StatusBadRequest)
return
}
topicsMap[topic] = true
}
// Subscribe to event feeds from information received in the beacon node runtime.
opsChan := make(chan *feed.Event, 1)
opsSub := s.OperationNotifier.OperationFeed().Subscribe(opsChan)
stateChan := make(chan *feed.Event, 1)
stateSub := s.StateNotifier.StateFeed().Subscribe(stateChan)
defer opsSub.Unsubscribe()
defer stateSub.Unsubscribe()
// Handle each event received and context cancelation.
// Set up SSE response headers
w.Header().Set("Content-Type", "text/event-stream")
w.Header().Set("Connection", "keep-alive")
// Handle each event received and context cancellation.
for {
select {
case event := <-opsChan:
if err := handleBlockOperationEvents(stream, requestedTopics, event); err != nil {
return status.Errorf(codes.Internal, "Could not handle block operations event: %v", err)
}
handleBlockOperationEvents(w, flusher, topicsMap, event)
case event := <-stateChan:
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():
return status.Errorf(codes.Canceled, "Context canceled")
case <-stream.Context().Done():
return status.Errorf(codes.Canceled, "Context canceled")
s.handleStateEvents(ctx, w, flusher, topicsMap, event)
case <-ctx.Done():
return
}
}
}
func handleBlockOperationEvents(
stream ethpbservice.Events_StreamEventsServer, requestedTopics map[string]bool, event *feed.Event,
) error {
func handleBlockOperationEvents(w http.ResponseWriter, flusher http.Flusher, requestedTopics map[string]bool, event *feed.Event) {
switch event.Type {
case operation.AggregatedAttReceived:
if _, ok := requestedTopics[AttestationTopic]; !ok {
return nil
return
}
attData, ok := event.Data.(*operation.AggregatedAttReceivedData)
if !ok {
return nil
write(w, flusher, topicDataMismatch, event.Data, AttestationTopic)
return
}
v1Data := migration.V1Alpha1AggregateAttAndProofToV1(attData.Attestation)
return streamData(stream, AttestationTopic, v1Data)
att := shared.AttestationFromConsensus(attData.Attestation.Aggregate)
send(w, flusher, AttestationTopic, att)
case operation.UnaggregatedAttReceived:
if _, ok := requestedTopics[AttestationTopic]; !ok {
return nil
return
}
attData, ok := event.Data.(*operation.UnAggregatedAttReceivedData)
if !ok {
return nil
write(w, flusher, topicDataMismatch, event.Data, AttestationTopic)
return
}
v1Data := migration.V1Alpha1AttestationToV1(attData.Attestation)
return streamData(stream, AttestationTopic, v1Data)
att := shared.AttestationFromConsensus(attData.Attestation)
send(w, flusher, AttestationTopic, att)
case operation.ExitReceived:
if _, ok := requestedTopics[VoluntaryExitTopic]; !ok {
return nil
return
}
exitData, ok := event.Data.(*operation.ExitReceivedData)
if !ok {
return nil
write(w, flusher, topicDataMismatch, event.Data, VoluntaryExitTopic)
return
}
v1Data := migration.V1Alpha1ExitToV1(exitData.Exit)
return streamData(stream, VoluntaryExitTopic, v1Data)
exit := shared.SignedVoluntaryExitFromConsensus(exitData.Exit)
send(w, flusher, VoluntaryExitTopic, exit)
case operation.SyncCommitteeContributionReceived:
if _, ok := requestedTopics[SyncCommitteeContributionTopic]; !ok {
return nil
return
}
contributionData, ok := event.Data.(*operation.SyncCommitteeContributionReceivedData)
if !ok {
return nil
write(w, flusher, topicDataMismatch, event.Data, SyncCommitteeContributionTopic)
return
}
v2Data := migration.V1Alpha1SignedContributionAndProofToV2(contributionData.Contribution)
return streamData(stream, SyncCommitteeContributionTopic, v2Data)
contribution := shared.SignedContributionAndProofFromConsensus(contributionData.Contribution)
send(w, flusher, SyncCommitteeContributionTopic, contribution)
case operation.BLSToExecutionChangeReceived:
if _, ok := requestedTopics[BLSToExecutionChangeTopic]; !ok {
return nil
return
}
changeData, ok := event.Data.(*operation.BLSToExecutionChangeReceivedData)
if !ok {
return nil
write(w, flusher, topicDataMismatch, event.Data, BLSToExecutionChangeTopic)
return
}
v2Change := migration.V1Alpha1SignedBLSToExecChangeToV2(changeData.Change)
return streamData(stream, BLSToExecutionChangeTopic, v2Change)
change, err := shared.SignedBlsToExecutionChangeFromConsensus(changeData.Change)
if err != nil {
write(w, flusher, err.Error())
return
}
send(w, flusher, BLSToExecutionChangeTopic, change)
case operation.BlobSidecarReceived:
if _, ok := requestedTopics[BlobSidecarTopic]; !ok {
return nil
return
}
blobData, ok := event.Data.(*operation.BlobSidecarReceivedData)
if !ok {
return nil
}
if blobData == nil || blobData.Blob == nil {
return nil
write(w, flusher, topicDataMismatch, event.Data, BlobSidecarTopic)
return
}
versionedHash := blockchain.ConvertKzgCommitmentToVersionedHash(blobData.Blob.Message.KzgCommitment)
blobEvent := &ethpb.EventBlobSidecar{
BlockRoot: bytesutil.SafeCopyBytes(blobData.Blob.Message.BlockRoot),
Index: blobData.Blob.Message.Index,
Slot: blobData.Blob.Message.Slot,
VersionedHash: bytesutil.SafeCopyBytes(versionedHash.Bytes()),
KzgCommitment: bytesutil.SafeCopyBytes(blobData.Blob.Message.KzgCommitment),
blobEvent := &BlobSidecarEvent{
BlockRoot: hexutil.Encode(blobData.Blob.Message.BlockRoot),
Index: fmt.Sprintf("%d", blobData.Blob.Message.Index),
Slot: fmt.Sprintf("%d", blobData.Blob.Message.Slot),
VersionedHash: versionedHash.String(),
KzgCommitment: hexutil.Encode(blobData.Blob.Message.KzgCommitment),
}
return streamData(stream, BlobSidecarTopic, blobEvent)
default:
return nil
send(w, flusher, BlobSidecarTopic, blobEvent)
}
}
func (s *Server) handleStateEvents(
stream ethpbservice.Events_StreamEventsServer, requestedTopics map[string]bool, event *feed.Event,
) error {
func (s *Server) handleStateEvents(ctx context.Context, w http.ResponseWriter, flusher http.Flusher, requestedTopics map[string]bool, event *feed.Event) {
switch event.Type {
case statefeed.NewHead:
if _, ok := requestedTopics[HeadTopic]; ok {
head, ok := event.Data.(*ethpb.EventHead)
headData, ok := event.Data.(*ethpb.EventHead)
if !ok {
return nil
write(w, flusher, topicDataMismatch, event.Data, HeadTopic)
return
}
return streamData(stream, HeadTopic, head)
head := &HeadEvent{
Slot: fmt.Sprintf("%d", headData.Slot),
Block: hexutil.Encode(headData.Block),
State: hexutil.Encode(headData.State),
EpochTransition: headData.EpochTransition,
ExecutionOptimistic: headData.ExecutionOptimistic,
PreviousDutyDependentRoot: hexutil.Encode(headData.PreviousDutyDependentRoot),
CurrentDutyDependentRoot: hexutil.Encode(headData.CurrentDutyDependentRoot),
}
send(w, flusher, HeadTopic, head)
}
if _, ok := requestedTopics[PayloadAttributesTopic]; ok {
if err := s.streamPayloadAttributes(stream); err != nil {
log.WithError(err).Error("Unable to obtain stream payload attributes")
}
return nil
s.sendPayloadAttributes(ctx, w, flusher)
}
return nil
case statefeed.MissedSlot:
if _, ok := requestedTopics[PayloadAttributesTopic]; ok {
if err := s.streamPayloadAttributes(stream); err != nil {
log.WithError(err).Error("Unable to obtain stream payload attributes")
}
return nil
s.sendPayloadAttributes(ctx, w, flusher)
}
return nil
case statefeed.FinalizedCheckpoint:
if _, ok := requestedTopics[FinalizedCheckpointTopic]; !ok {
return nil
return
}
finalizedCheckpoint, ok := event.Data.(*ethpb.EventFinalizedCheckpoint)
checkpointData, ok := event.Data.(*ethpb.EventFinalizedCheckpoint)
if !ok {
return nil
write(w, flusher, topicDataMismatch, event.Data, FinalizedCheckpointTopic)
return
}
return streamData(stream, FinalizedCheckpointTopic, finalizedCheckpoint)
checkpoint := &FinalizedCheckpointEvent{
Block: hexutil.Encode(checkpointData.Block),
State: hexutil.Encode(checkpointData.State),
Epoch: fmt.Sprintf("%d", checkpointData.Epoch),
ExecutionOptimistic: checkpointData.ExecutionOptimistic,
}
send(w, flusher, FinalizedCheckpointTopic, checkpoint)
case statefeed.Reorg:
if _, ok := requestedTopics[ChainReorgTopic]; !ok {
return nil
return
}
reorg, ok := event.Data.(*ethpb.EventChainReorg)
reorgData, ok := event.Data.(*ethpb.EventChainReorg)
if !ok {
return nil
write(w, flusher, topicDataMismatch, event.Data, ChainReorgTopic)
return
}
return streamData(stream, ChainReorgTopic, reorg)
reorg := &ChainReorgEvent{
Slot: fmt.Sprintf("%d", reorgData.Slot),
Depth: fmt.Sprintf("%d", reorgData.Depth),
OldHeadBlock: hexutil.Encode(reorgData.OldHeadBlock),
NewHeadBlock: hexutil.Encode(reorgData.NewHeadBlock),
OldHeadState: hexutil.Encode(reorgData.OldHeadState),
NewHeadState: hexutil.Encode(reorgData.NewHeadState),
Epoch: fmt.Sprintf("%d", reorgData.Epoch),
ExecutionOptimistic: reorgData.ExecutionOptimistic,
}
send(w, flusher, ChainReorgTopic, reorg)
case statefeed.BlockProcessed:
if _, ok := requestedTopics[BlockTopic]; !ok {
return nil
return
}
blkData, ok := event.Data.(*statefeed.BlockProcessedData)
if !ok {
return nil
write(w, flusher, topicDataMismatch, event.Data, BlockTopic)
return
}
v1Data, err := migration.BlockIfaceToV1BlockHeader(blkData.SignedBlock)
blockRoot, err := blkData.SignedBlock.Block().HashTreeRoot()
if err != nil {
return err
write(w, flusher, "Could not get block root: "+err.Error())
return
}
item, err := v1Data.Message.HashTreeRoot()
if err != nil {
return errors.Wrap(err, "could not hash tree root block")
}
eventBlock := &ethpb.EventBlock{
Slot: blkData.Slot,
Block: item[:],
blk := &BlockEvent{
Slot: fmt.Sprintf("%d", blkData.Slot),
Block: hexutil.Encode(blockRoot[:]),
ExecutionOptimistic: blkData.Optimistic,
}
return streamData(stream, BlockTopic, eventBlock)
default:
return nil
send(w, flusher, BlockTopic, blk)
}
}
// streamPayloadAttributes on new head event.
// This event stream is intended to be used by builders and relays.
// parent_ fields are based on state at N_{current_slot}, while the rest of fields are based on state of N_{current_slot + 1}
func (s *Server) streamPayloadAttributes(stream ethpbservice.Events_StreamEventsServer) error {
headRoot, err := s.HeadFetcher.HeadRoot(s.Ctx)
// Parent fields are based on state at N_{current_slot}, while the rest of fields are based on state of N_{current_slot + 1}
func (s *Server) sendPayloadAttributes(ctx context.Context, w http.ResponseWriter, flusher http.Flusher) {
headRoot, err := s.HeadFetcher.HeadRoot(ctx)
if err != nil {
return errors.Wrap(err, "could not get head root")
write(w, flusher, "Could not get head root: "+err.Error())
return
}
st, err := s.HeadFetcher.HeadState(s.Ctx)
st, err := s.HeadFetcher.HeadState(ctx)
if err != nil {
return errors.Wrap(err, "could not get head state")
write(w, flusher, "Could not get head state: "+err.Error())
return
}
// advance the headstate
headState, err := transition.ProcessSlotsIfPossible(s.Ctx, st, s.ChainInfoFetcher.CurrentSlot()+1)
// advance the head state
headState, err := transition.ProcessSlotsIfPossible(ctx, st, s.ChainInfoFetcher.CurrentSlot()+1)
if err != nil {
return err
write(w, flusher, "Could not advance head state: "+err.Error())
return
}
headBlock, err := s.HeadFetcher.HeadBlock(s.Ctx)
headBlock, err := s.HeadFetcher.HeadBlock(ctx)
if err != nil {
return err
write(w, flusher, "Could not get head block: "+err.Error())
return
}
headPayload, err := headBlock.Block().Body().Execution()
if err != nil {
return err
write(w, flusher, "Could not get execution payload: "+err.Error())
return
}
t, err := slots.ToTime(headState.GenesisTime(), headState.Slot())
if err != nil {
return err
write(w, flusher, "Could not get head state slot time: "+err.Error())
return
}
prevRando, err := helpers.RandaoMix(headState, time.CurrentEpoch(headState))
if err != nil {
return err
write(w, flusher, "Could not get head state randao mix: "+err.Error())
return
}
proposerIndex, err := helpers.BeaconProposerIndex(s.Ctx, headState)
proposerIndex, err := helpers.BeaconProposerIndex(ctx, headState)
if err != nil {
return err
write(w, flusher, "Could not get head state proposer index: "+err.Error())
return
}
var attributes interface{}
switch headState.Version() {
case version.Bellatrix:
return streamData(stream, PayloadAttributesTopic, &ethpb.EventPayloadAttributeV1{
Version: version.String(headState.Version()),
Data: &ethpb.EventPayloadAttributeV1_BasePayloadAttribute{
ProposerIndex: proposerIndex,
ProposalSlot: headState.Slot(),
ParentBlockNumber: headPayload.BlockNumber(),
ParentBlockRoot: headRoot,
ParentBlockHash: headPayload.BlockHash(),
PayloadAttributes: &enginev1.PayloadAttributes{
Timestamp: uint64(t.Unix()),
PrevRandao: prevRando,
SuggestedFeeRecipient: headPayload.FeeRecipient(),
},
},
})
case version.Capella, version.Deneb:
attributes = &PayloadAttributesV1{
Timestamp: fmt.Sprintf("%d", t.Unix()),
PrevRandao: hexutil.Encode(prevRando),
SuggestedFeeRecipient: hexutil.Encode(headPayload.FeeRecipient()),
}
case version.Capella:
withdrawals, err := headState.ExpectedWithdrawals()
if err != nil {
return err
write(w, flusher, "Could not get head state expected withdrawals: "+err.Error())
return
}
attributes = &PayloadAttributesV2{
Timestamp: fmt.Sprintf("%d", t.Unix()),
PrevRandao: hexutil.Encode(prevRando),
SuggestedFeeRecipient: hexutil.Encode(headPayload.FeeRecipient()),
Withdrawals: shared.WithdrawalsFromConsensus(withdrawals),
}
case version.Deneb:
withdrawals, err := headState.ExpectedWithdrawals()
if err != nil {
write(w, flusher, "Could not get head state expected withdrawals: "+err.Error())
return
}
parentRoot, err := headBlock.Block().HashTreeRoot()
if err != nil {
write(w, flusher, "Could not get head block root: "+err.Error())
return
}
attributes = &PayloadAttributesV3{
Timestamp: fmt.Sprintf("%d", t.Unix()),
PrevRandao: hexutil.Encode(prevRando),
SuggestedFeeRecipient: hexutil.Encode(headPayload.FeeRecipient()),
Withdrawals: shared.WithdrawalsFromConsensus(withdrawals),
ParentBeaconBlockRoot: hexutil.Encode(parentRoot[:]),
}
return streamData(stream, PayloadAttributesTopic, &ethpb.EventPayloadAttributeV2{
Version: version.String(headState.Version()),
Data: &ethpb.EventPayloadAttributeV2_BasePayloadAttribute{
ProposerIndex: proposerIndex,
ProposalSlot: headState.Slot(),
ParentBlockNumber: headPayload.BlockNumber(),
ParentBlockRoot: headRoot,
ParentBlockHash: headPayload.BlockHash(),
PayloadAttributes: &enginev1.PayloadAttributesV2{
Timestamp: uint64(t.Unix()),
PrevRandao: prevRando,
SuggestedFeeRecipient: headPayload.FeeRecipient(),
Withdrawals: withdrawals,
},
},
})
default:
return errors.New("payload version is not supported")
write(w, flusher, "Payload version %s is not supported", version.String(headState.Version()))
return
}
}
func streamData(stream ethpbservice.Events_StreamEventsServer, name string, data proto.Message) error {
returnData, err := anypb.New(data)
attributesBytes, err := json.Marshal(attributes)
if err != nil {
return err
write(w, flusher, err.Error())
return
}
return stream.Send(&gwpb.EventSource{
Event: name,
Data: returnData,
eventData := PayloadAttributesEventData{
ProposerIndex: fmt.Sprintf("%d", proposerIndex),
ProposalSlot: fmt.Sprintf("%d", headState.Slot()),
ParentBlockNumber: fmt.Sprintf("%d", headPayload.BlockNumber()),
ParentBlockRoot: hexutil.Encode(headRoot),
ParentBlockHash: hexutil.Encode(headPayload.BlockHash()),
PayloadAttributes: attributesBytes,
}
eventDataBytes, err := json.Marshal(eventData)
if err != nil {
write(w, flusher, err.Error())
return
}
send(w, flusher, PayloadAttributesTopic, &PayloadAttributesEvent{
Version: version.String(headState.Version()),
Data: eventDataBytes,
})
}
func send(w http.ResponseWriter, flusher http.Flusher, name string, data interface{}) {
j, err := json.Marshal(data)
if err != nil {
write(w, flusher, "Could not marshal event to JSON: "+err.Error())
return
}
write(w, flusher, "event: %s\ndata: %s\n\n", name, string(j))
}
func write(w http.ResponseWriter, flusher http.Flusher, format string, a ...any) {
_, err := fmt.Fprintf(w, format, a...)
if err != nil {
log.WithError(err).Error("Could not write to response writer")
}
flusher.Flush()
}

File diff suppressed because it is too large Load Diff

View File

@ -4,8 +4,6 @@
package events
import (
"context"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain"
opfeed "github.com/prysmaticlabs/prysm/v4/beacon-chain/core/feed/operation"
statefeed "github.com/prysmaticlabs/prysm/v4/beacon-chain/core/feed/state"
@ -14,7 +12,6 @@ import (
// Server defines a server implementation of the gRPC events service,
// providing RPC endpoints to subscribe to events from the beacon node.
type Server struct {
Ctx context.Context
StateNotifier statefeed.Notifier
OperationNotifier opfeed.Notifier
HeadFetcher blockchain.HeadFetcher

View File

@ -0,0 +1,94 @@
package events
import (
"encoding/json"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared"
)
type HeadEvent struct {
Slot string `json:"slot"`
Block string `json:"block"`
State string `json:"state"`
EpochTransition bool `json:"epoch_transition"`
ExecutionOptimistic bool `json:"execution_optimistic"`
PreviousDutyDependentRoot string `json:"previous_duty_dependent_root"`
CurrentDutyDependentRoot string `json:"current_duty_dependent_root"`
}
type BlockEvent struct {
Slot string `json:"slot"`
Block string `json:"block"`
ExecutionOptimistic bool `json:"execution_optimistic"`
}
type AggregatedAttEventSource struct {
Aggregate *shared.Attestation `json:"aggregate"`
}
type UnaggregatedAttEventSource struct {
AggregationBits string `json:"aggregation_bits"`
Data *shared.AttestationData `json:"data"`
Signature string `json:"signature"`
}
type FinalizedCheckpointEvent struct {
Block string `json:"block"`
State string `json:"state"`
Epoch string `json:"epoch"`
ExecutionOptimistic bool `json:"execution_optimistic"`
}
type ChainReorgEvent struct {
Slot string `json:"slot"`
Depth string `json:"depth"`
OldHeadBlock string `json:"old_head_block"`
NewHeadBlock string `json:"old_head_state"`
OldHeadState string `json:"new_head_block"`
NewHeadState string `json:"new_head_state"`
Epoch string `json:"epoch"`
ExecutionOptimistic bool `json:"execution_optimistic"`
}
type PayloadAttributesEvent struct {
Version string `json:"version"`
Data json.RawMessage `json:"data"`
}
type PayloadAttributesEventData struct {
ProposerIndex string `json:"proposer_index"`
ProposalSlot string `json:"proposal_slot"`
ParentBlockNumber string `json:"parent_block_number"`
ParentBlockRoot string `json:"parent_block_root"`
ParentBlockHash string `json:"parent_block_hash"`
PayloadAttributes json.RawMessage `json:"payload_attributes"`
}
type PayloadAttributesV1 struct {
Timestamp string `json:"timestamp"`
PrevRandao string `json:"prev_randao"`
SuggestedFeeRecipient string `json:"suggested_fee_recipient"`
}
type PayloadAttributesV2 struct {
Timestamp string `json:"timestamp"`
PrevRandao string `json:"prev_randao"`
SuggestedFeeRecipient string `json:"suggested_fee_recipient"`
Withdrawals []*shared.Withdrawal `json:"withdrawals"`
}
type PayloadAttributesV3 struct {
Timestamp string `json:"timestamp"`
PrevRandao string `json:"prev_randao"`
SuggestedFeeRecipient string `json:"suggested_fee_recipient"`
Withdrawals []*shared.Withdrawal `json:"withdrawals"`
ParentBeaconBlockRoot string `json:"parent_beacon_block_root"`
}
type BlobSidecarEvent struct {
BlockRoot string `json:"block_root"`
Index string `json:"index"`
Slot string `json:"slot"`
KzgCommitment string `json:"kzg_commitment"`
VersionedHash string `json:"versioned_hash"`
}

View File

@ -326,6 +326,14 @@ func (s *SignedContributionAndProof) ToConsensus() (*eth.SignedContributionAndPr
}, nil
}
func SignedContributionAndProofFromConsensus(c *eth.SignedContributionAndProof) *SignedContributionAndProof {
contribution := ContributionAndProofFromConsensus(c.Message)
return &SignedContributionAndProof{
Message: contribution,
Signature: hexutil.Encode(c.Signature),
}
}
func (c *ContributionAndProof) ToConsensus() (*eth.ContributionAndProof, error) {
contribution, err := c.Contribution.ToConsensus()
if err != nil {
@ -347,6 +355,15 @@ func (c *ContributionAndProof) ToConsensus() (*eth.ContributionAndProof, error)
}, nil
}
func ContributionAndProofFromConsensus(c *eth.ContributionAndProof) *ContributionAndProof {
contribution := SyncCommitteeContributionFromConsensus(c.Contribution)
return &ContributionAndProof{
AggregatorIndex: fmt.Sprintf("%d", c.AggregatorIndex),
Contribution: contribution,
SelectionProof: hexutil.Encode(c.SelectionProof),
}
}
func (s *SyncCommitteeContribution) ToConsensus() (*eth.SyncCommitteeContribution, error) {
slot, err := strconv.ParseUint(s.Slot, 10, 64)
if err != nil {
@ -378,6 +395,16 @@ func (s *SyncCommitteeContribution) ToConsensus() (*eth.SyncCommitteeContributio
}, nil
}
func SyncCommitteeContributionFromConsensus(c *eth.SyncCommitteeContribution) *SyncCommitteeContribution {
return &SyncCommitteeContribution{
Slot: fmt.Sprintf("%d", c.Slot),
BeaconBlockRoot: hexutil.Encode(c.BlockRoot),
SubcommitteeIndex: fmt.Sprintf("%d", c.SubcommitteeIndex),
AggregationBits: hexutil.Encode(c.AggregationBits),
Signature: hexutil.Encode(c.Signature),
}
}
func (s *SignedAggregateAttestationAndProof) ToConsensus() (*eth.SignedAggregateAttestationAndProof, error) {
msg, err := s.Message.ToConsensus()
if err != nil {

View File

@ -8,6 +8,7 @@ import (
"github.com/pkg/errors"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
enginev1 "github.com/prysmaticlabs/prysm/v4/proto/engine/v1"
eth "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
)
@ -561,6 +562,23 @@ type Withdrawal struct {
Amount string `json:"amount" validate:"required"`
}
func WithdrawalsFromConsensus(ws []*enginev1.Withdrawal) []*Withdrawal {
result := make([]*Withdrawal, len(ws))
for i, w := range ws {
result[i] = WithdrawalFromConsensus(w)
}
return result
}
func WithdrawalFromConsensus(w *enginev1.Withdrawal) *Withdrawal {
return &Withdrawal{
WithdrawalIndex: fmt.Sprintf("%d", w.Index),
ValidatorIndex: fmt.Sprintf("%d", w.ValidatorIndex),
ExecutionAddress: hexutil.Encode(w.Address),
Amount: fmt.Sprintf("%d", w.Amount),
}
}
type SignedBlsToExecutionChange struct {
Message *BlsToExecutionChange `json:"message" validate:"required"`
Signature string `json:"signature" validate:"required"`

View File

@ -15,6 +15,7 @@ import (
grpcopentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
grpcprometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/events"
beacon2 "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/prysm/beacon"
nodeprysm "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/prysm/node"
validatorprysm "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/prysm/validator"
@ -46,7 +47,6 @@ import (
rpcBuilder "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/builder"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/config"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/debug"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/events"
lightclient "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/light-client"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/node"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/rewards"
@ -64,7 +64,6 @@ import (
"github.com/prysmaticlabs/prysm/v4/config/params"
"github.com/prysmaticlabs/prysm/v4/io/logs"
"github.com/prysmaticlabs/prysm/v4/monitoring/tracing"
ethpbservice "github.com/prysmaticlabs/prysm/v4/proto/eth/service"
ethpbv1alpha1 "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
)
@ -453,6 +452,14 @@ func (s *Service) Start() {
s.cfg.Router.HandleFunc("/eth/v1/config/fork_schedule", config.GetForkSchedule).Methods(http.MethodGet)
s.cfg.Router.HandleFunc("/eth/v1/config/spec", config.GetSpec).Methods(http.MethodGet)
eventsServer := &events.Server{
StateNotifier: s.cfg.StateNotifier,
OperationNotifier: s.cfg.OperationNotifier,
HeadFetcher: s.cfg.HeadFetcher,
ChainInfoFetcher: s.cfg.ChainInfoFetcher,
}
s.cfg.Router.HandleFunc("/eth/v1/events", eventsServer.StreamEvents).Methods(http.MethodGet)
lightClientServer := &lightclient.Server{
Blocker: blocker,
Stater: stater,
@ -466,13 +473,6 @@ func (s *Service) Start() {
ethpbv1alpha1.RegisterNodeServer(s.grpcServer, nodeServer)
ethpbv1alpha1.RegisterHealthServer(s.grpcServer, nodeServer)
ethpbv1alpha1.RegisterBeaconChainServer(s.grpcServer, beaconChainServer)
ethpbservice.RegisterEventsServer(s.grpcServer, &events.Server{
Ctx: s.ctx,
StateNotifier: s.cfg.StateNotifier,
OperationNotifier: s.cfg.OperationNotifier,
HeadFetcher: s.cfg.HeadFetcher,
ChainInfoFetcher: s.cfg.ChainInfoFetcher,
})
if s.cfg.EnableDebugRPCEndpoints {
log.Info("Enabled debug gRPC endpoints")
debugServer := &debugv1alpha1.Server{

2
go.mod
View File

@ -63,7 +63,6 @@ require (
github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7
github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c
github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294
github.com/r3labs/sse/v2 v2.10.0
github.com/rs/cors v1.7.0
github.com/schollz/progressbar/v3 v3.3.4
github.com/sirupsen/logrus v1.9.0
@ -238,7 +237,6 @@ require (
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect

5
go.sum
View File

@ -1137,8 +1137,6 @@ github.com/quic-go/quic-go v0.33.0 h1:ItNoTDN/Fm/zBlq769lLJc8ECe9gYaW40veHCCco7y
github.com/quic-go/quic-go v0.33.0/go.mod h1:YMuhaAV9/jIu0XclDXwZPAsP/2Kgr5yMYhe9oxhhOFA=
github.com/quic-go/webtransport-go v0.5.2 h1:GA6Bl6oZY+g/flt00Pnu0XtivSD8vukOu3lYhJjnGEk=
github.com/quic-go/webtransport-go v0.5.2/go.mod h1:OhmmgJIzTTqXK5xvtuX0oBpLV2GkLWNDA+UeTGJXErU=
github.com/r3labs/sse/v2 v2.10.0 h1:hFEkLLFY4LDifoHdiCN/LlGBAdVJYsANaLqNYa1l/v0=
github.com/r3labs/sse/v2 v2.10.0/go.mod h1:Igau6Whc+F17QUgML1fYe1VPZzTV6EMCnYktEmkNJ7I=
github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk=
github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
@ -1514,7 +1512,6 @@ golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191116160921-f9c825593386/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@ -1971,8 +1968,6 @@ google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cn
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610=
gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y=
gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UDAkHu8BrjI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View File

@ -1,98 +0,0 @@
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@prysm//tools/go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:compiler.bzl", "go_proto_compiler")
# gazelle:ignore
proto_library(
name = "proto",
srcs = [
"events_service.proto",
],
visibility = ["//visibility:public"],
deps = [
"//proto/eth/ext:proto",
"//proto/eth/v1:proto",
"//proto/eth/v2:proto",
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:event_source_proto",
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:timestamp_proto",
"@googleapis//google/api:annotations_proto",
],
)
go_proto_library(
name = "go_proto",
compilers = ["@com_github_prysmaticlabs_protoc_gen_go_cast//:go_cast_grpc"],
importpath = "github.com/prysmaticlabs/prysm/v4/proto/eth/service",
proto = ":proto",
visibility = ["//visibility:public"],
deps = [
"//consensus-types/primitives:go_default_library",
"//proto/eth/ext:go_default_library",
"//proto/eth/v1:go_default_library",
"//proto/eth/v2:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:go_default_library",
"@googleapis//google/api:annotations_go_proto",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@org_golang_google_protobuf//types/descriptorpb:go_default_library",
"@org_golang_google_protobuf//types/known/emptypb:go_default_library",
],
)
go_proto_compiler(
name = "allow_delete_body_gateway_compiler",
options = [
"logtostderr=true",
"allow_repeated_fields_in_body=true",
"allow_delete_body=true",
],
plugin = "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:protoc-gen-grpc-gateway",
suffix = ".pb.gw.go",
visibility = ["//visibility:public"],
deps = [
"@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//utilities:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//grpclog:go_default_library",
"@org_golang_google_grpc//metadata:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
],
)
go_proto_library(
name = "go_grpc_gateway_library",
compilers = [
"allow_delete_body_gateway_compiler",
],
embed = [":go_proto"],
importpath = "github.com/prysmaticlabs/prysm/v4/proto/eth/service",
protos = [":proto"],
visibility = ["//proto:__subpackages__"],
deps = [
"//proto/eth/ext:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto",
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
"@googleapis//google/api:annotations_go_proto",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
],
)
go_library(
name = "go_default_library",
embed = [":go_grpc_gateway_library"],
importpath = "github.com/prysmaticlabs/prysm/v4/proto/eth/service",
visibility = ["//visibility:public"],
deps = [
"@org_golang_google_protobuf//types/descriptorpb",
"@org_golang_google_protobuf//types/known/emptypb",
],
)

View File

@ -1,209 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.23.3
// source: proto/eth/service/events_service.proto
package service
import (
context "context"
reflect "reflect"
gateway "github.com/grpc-ecosystem/grpc-gateway/v2/proto/gateway"
v1 "github.com/prysmaticlabs/prysm/v4/proto/eth/v1"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "google.golang.org/protobuf/types/descriptorpb"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
var File_proto_eth_service_events_service_proto protoreflect.FileDescriptor
var file_proto_eth_service_events_service_proto_rawDesc = []byte{
0x0a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x73, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65,
0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x1c,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f,
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, 0x19,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65,
0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x73,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x77, 0x0a, 0x06, 0x45,
0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x6d, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45,
0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x24, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76,
0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x67, 0x61,
0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x69, 0x6e, 0x74, 0x65,
0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e,
0x74, 0x73, 0x30, 0x01, 0x42, 0x93, 0x01, 0x0a, 0x18, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68,
0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x42, 0x12, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62,
0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x65, 0x74, 0x68, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xaa, 0x02, 0x14, 0x45,
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0xca, 0x02, 0x14, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45,
0x74, 0x68, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var file_proto_eth_service_events_service_proto_goTypes = []interface{}{
(*v1.StreamEventsRequest)(nil), // 0: ethereum.eth.v1.StreamEventsRequest
(*gateway.EventSource)(nil), // 1: gateway.EventSource
}
var file_proto_eth_service_events_service_proto_depIdxs = []int32{
0, // 0: ethereum.eth.service.Events.StreamEvents:input_type -> ethereum.eth.v1.StreamEventsRequest
1, // 1: ethereum.eth.service.Events.StreamEvents:output_type -> gateway.EventSource
1, // [1:2] is the sub-list for method output_type
0, // [0:1] 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
}
func init() { file_proto_eth_service_events_service_proto_init() }
func file_proto_eth_service_events_service_proto_init() {
if File_proto_eth_service_events_service_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_proto_eth_service_events_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_proto_eth_service_events_service_proto_goTypes,
DependencyIndexes: file_proto_eth_service_events_service_proto_depIdxs,
}.Build()
File_proto_eth_service_events_service_proto = out.File
file_proto_eth_service_events_service_proto_rawDesc = nil
file_proto_eth_service_events_service_proto_goTypes = nil
file_proto_eth_service_events_service_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// EventsClient is the client API for Events service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type EventsClient interface {
StreamEvents(ctx context.Context, in *v1.StreamEventsRequest, opts ...grpc.CallOption) (Events_StreamEventsClient, error)
}
type eventsClient struct {
cc grpc.ClientConnInterface
}
func NewEventsClient(cc grpc.ClientConnInterface) EventsClient {
return &eventsClient{cc}
}
func (c *eventsClient) StreamEvents(ctx context.Context, in *v1.StreamEventsRequest, opts ...grpc.CallOption) (Events_StreamEventsClient, error) {
stream, err := c.cc.NewStream(ctx, &_Events_serviceDesc.Streams[0], "/ethereum.eth.service.Events/StreamEvents", opts...)
if err != nil {
return nil, err
}
x := &eventsStreamEventsClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Events_StreamEventsClient interface {
Recv() (*gateway.EventSource, error)
grpc.ClientStream
}
type eventsStreamEventsClient struct {
grpc.ClientStream
}
func (x *eventsStreamEventsClient) Recv() (*gateway.EventSource, error) {
m := new(gateway.EventSource)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// EventsServer is the server API for Events service.
type EventsServer interface {
StreamEvents(*v1.StreamEventsRequest, Events_StreamEventsServer) error
}
// UnimplementedEventsServer can be embedded to have forward compatible implementations.
type UnimplementedEventsServer struct {
}
func (*UnimplementedEventsServer) StreamEvents(*v1.StreamEventsRequest, Events_StreamEventsServer) error {
return status.Errorf(codes.Unimplemented, "method StreamEvents not implemented")
}
func RegisterEventsServer(s *grpc.Server, srv EventsServer) {
s.RegisterService(&_Events_serviceDesc, srv)
}
func _Events_StreamEvents_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(v1.StreamEventsRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(EventsServer).StreamEvents(m, &eventsStreamEventsServer{stream})
}
type Events_StreamEventsServer interface {
Send(*gateway.EventSource) error
grpc.ServerStream
}
type eventsStreamEventsServer struct {
grpc.ServerStream
}
func (x *eventsStreamEventsServer) Send(m *gateway.EventSource) error {
return x.ServerStream.SendMsg(m)
}
var _Events_serviceDesc = grpc.ServiceDesc{
ServiceName: "ethereum.eth.service.Events",
HandlerType: (*EventsServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "StreamEvents",
Handler: _Events_StreamEvents_Handler,
ServerStreams: true,
},
},
Metadata: "proto/eth/service/events_service.proto",
}

View File

@ -1,150 +0,0 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: proto/eth/service/events_service.proto
/*
Package service is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package service
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
github_com_prysmaticlabs_prysm_v4_consensus_types_primitives "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
v1 "github.com/prysmaticlabs/prysm/v4/proto/eth/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/emptypb"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
var _ = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(0)
var _ = emptypb.Empty{}
var (
filter_Events_StreamEvents_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Events_StreamEvents_0(ctx context.Context, marshaler runtime.Marshaler, client EventsClient, req *http.Request, pathParams map[string]string) (Events_StreamEventsClient, runtime.ServerMetadata, error) {
var protoReq v1.StreamEventsRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Events_StreamEvents_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
stream, err := client.StreamEvents(ctx, &protoReq)
if err != nil {
return nil, metadata, err
}
header, err := stream.Header()
if err != nil {
return nil, metadata, err
}
metadata.HeaderMD = header
return stream, metadata, nil
}
// RegisterEventsHandlerServer registers the http handlers for service Events to "mux".
// UnaryRPC :call EventsServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterEventsHandlerFromEndpoint instead.
func RegisterEventsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EventsServer) error {
mux.Handle("GET", pattern_Events_StreamEvents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
})
return nil
}
// RegisterEventsHandlerFromEndpoint is same as RegisterEventsHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterEventsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterEventsHandler(ctx, mux, conn)
}
// RegisterEventsHandler registers the http handlers for service Events to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterEventsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterEventsHandlerClient(ctx, mux, NewEventsClient(conn))
}
// RegisterEventsHandlerClient registers the http handlers for service Events
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EventsClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EventsClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "EventsClient" to call the correct interceptors.
func RegisterEventsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EventsClient) error {
mux.Handle("GET", pattern_Events_StreamEvents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.Events/StreamEvents")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Events_StreamEvents_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Events_StreamEvents_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_Events_StreamEvents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"internal", "eth", "v1", "events"}, ""))
)
var (
forward_Events_StreamEvents_0 = runtime.ForwardResponseStream
)

View File

@ -1,44 +0,0 @@
// Copyright 2020 Prysmatic Labs.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package ethereum.eth.service;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "proto/eth/v1/events.proto";
import "proto/gateway/event_source.proto";
option csharp_namespace = "Ethereum.Eth.Service";
option go_package = "github.com/prysmaticlabs/prysm/v4/proto/eth/service";
option java_multiple_files = true;
option java_outer_classname = "EventsServiceProto";
option java_package = "org.ethereum.eth.service";
option php_namespace = "Ethereum\\Eth\\Service";
// Events API
//
// This service is defined in the upstream Ethereum consensus APIs repository (beacon-apis/apis/debug).
service Events {
// Provides endpoint to subscribe to beacon node Server-Sent-Events stream. Consumers should use eventsource implementation to listen on those events.
// Servers may send SSE comments beginning with : for any purpose, including to keep the event stream connection alive in the presence of proxy servers.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Events/eventstream
rpc StreamEvents(v1.StreamEventsRequest) returns (stream gateway.EventSource) {
option (google.api.http) = {
get: "/internal/eth/v1/events"
};
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,317 +0,0 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: proto/eth/service/key_management.proto
/*
Package service is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package service
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
github_com_prysmaticlabs_prysm_v4_consensus_types_primitives "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/emptypb"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
var _ = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(0)
var _ = emptypb.Empty{}
func request_KeyManagement_ListKeystores_0(ctx context.Context, marshaler runtime.Marshaler, client KeyManagementClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty
var metadata runtime.ServerMetadata
msg, err := client.ListKeystores(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_KeyManagement_ListKeystores_0(ctx context.Context, marshaler runtime.Marshaler, server KeyManagementServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq emptypb.Empty
var metadata runtime.ServerMetadata
msg, err := server.ListKeystores(ctx, &protoReq)
return msg, metadata, err
}
func request_KeyManagement_ImportKeystores_0(ctx context.Context, marshaler runtime.Marshaler, client KeyManagementClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ImportKeystoresRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ImportKeystores(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_KeyManagement_ImportKeystores_0(ctx context.Context, marshaler runtime.Marshaler, server KeyManagementServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ImportKeystoresRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ImportKeystores(ctx, &protoReq)
return msg, metadata, err
}
func request_KeyManagement_DeleteKeystores_0(ctx context.Context, marshaler runtime.Marshaler, client KeyManagementClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeleteKeystoresRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.DeleteKeystores(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_KeyManagement_DeleteKeystores_0(ctx context.Context, marshaler runtime.Marshaler, server KeyManagementServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeleteKeystoresRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.DeleteKeystores(ctx, &protoReq)
return msg, metadata, err
}
// RegisterKeyManagementHandlerServer registers the http handlers for service KeyManagement to "mux".
// UnaryRPC :call KeyManagementServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterKeyManagementHandlerFromEndpoint instead.
func RegisterKeyManagementHandlerServer(ctx context.Context, mux *runtime.ServeMux, server KeyManagementServer) error {
mux.Handle("GET", pattern_KeyManagement_ListKeystores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.service.KeyManagement/ListKeystores")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_KeyManagement_ListKeystores_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_KeyManagement_ListKeystores_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_KeyManagement_ImportKeystores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.service.KeyManagement/ImportKeystores")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_KeyManagement_ImportKeystores_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_KeyManagement_ImportKeystores_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("DELETE", pattern_KeyManagement_DeleteKeystores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.service.KeyManagement/DeleteKeystores")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_KeyManagement_DeleteKeystores_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_KeyManagement_DeleteKeystores_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterKeyManagementHandlerFromEndpoint is same as RegisterKeyManagementHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterKeyManagementHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterKeyManagementHandler(ctx, mux, conn)
}
// RegisterKeyManagementHandler registers the http handlers for service KeyManagement to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterKeyManagementHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterKeyManagementHandlerClient(ctx, mux, NewKeyManagementClient(conn))
}
// RegisterKeyManagementHandlerClient registers the http handlers for service KeyManagement
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "KeyManagementClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "KeyManagementClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "KeyManagementClient" to call the correct interceptors.
func RegisterKeyManagementHandlerClient(ctx context.Context, mux *runtime.ServeMux, client KeyManagementClient) error {
mux.Handle("GET", pattern_KeyManagement_ListKeystores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.KeyManagement/ListKeystores")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_KeyManagement_ListKeystores_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_KeyManagement_ListKeystores_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_KeyManagement_ImportKeystores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.KeyManagement/ImportKeystores")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_KeyManagement_ImportKeystores_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_KeyManagement_ImportKeystores_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("DELETE", pattern_KeyManagement_DeleteKeystores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.KeyManagement/DeleteKeystores")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_KeyManagement_DeleteKeystores_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_KeyManagement_DeleteKeystores_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_KeyManagement_ListKeystores_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"internal", "eth", "v1", "keystores"}, ""))
pattern_KeyManagement_ImportKeystores_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"internal", "eth", "v1", "keystores"}, ""))
pattern_KeyManagement_DeleteKeystores_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"internal", "eth", "v1", "keystores"}, ""))
)
var (
forward_KeyManagement_ListKeystores_0 = runtime.ForwardResponseMessage
forward_KeyManagement_ImportKeystores_0 = runtime.ForwardResponseMessage
forward_KeyManagement_DeleteKeystores_0 = runtime.ForwardResponseMessage
)

View File

@ -77,8 +77,6 @@ var file_proto_eth_v1_beacon_chain_proto_rawDesc = []byte{
0x6f, 0x12, 0x0f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e,
0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 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, 0x1e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f,
0x76, 0x31, 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x29, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x74, 0x61, 0x74, 0x65, 0x49, 0x64, 0x42,
@ -122,7 +120,6 @@ func file_proto_eth_v1_beacon_chain_proto_init() {
if File_proto_eth_v1_beacon_chain_proto != nil {
return
}
file_proto_eth_v1_attestation_proto_init()
if !protoimpl.UnsafeEnabled {
file_proto_eth_v1_beacon_chain_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StateRequest); i {

View File

@ -11,7 +11,7 @@ import (
sync "sync"
github_com_prysmaticlabs_prysm_v4_consensus_types_primitives "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
v1 "github.com/prysmaticlabs/prysm/v4/proto/engine/v1"
_ "github.com/prysmaticlabs/prysm/v4/proto/engine/v1"
_ "github.com/prysmaticlabs/prysm/v4/proto/eth/ext"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
@ -25,53 +25,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type StreamEventsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Topics []string `protobuf:"bytes,1,rep,name=topics,proto3" json:"topics,omitempty"`
}
func (x *StreamEventsRequest) Reset() {
*x = StreamEventsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_eth_v1_events_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StreamEventsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StreamEventsRequest) ProtoMessage() {}
func (x *StreamEventsRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_eth_v1_events_proto_msgTypes[0]
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 StreamEventsRequest.ProtoReflect.Descriptor instead.
func (*StreamEventsRequest) Descriptor() ([]byte, []int) {
return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{0}
}
func (x *StreamEventsRequest) GetTopics() []string {
if x != nil {
return x.Topics
}
return nil
}
type EventHead struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -89,7 +42,7 @@ type EventHead struct {
func (x *EventHead) Reset() {
*x = EventHead{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_eth_v1_events_proto_msgTypes[1]
mi := &file_proto_eth_v1_events_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -102,7 +55,7 @@ func (x *EventHead) String() string {
func (*EventHead) ProtoMessage() {}
func (x *EventHead) ProtoReflect() protoreflect.Message {
mi := &file_proto_eth_v1_events_proto_msgTypes[1]
mi := &file_proto_eth_v1_events_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -115,7 +68,7 @@ func (x *EventHead) ProtoReflect() protoreflect.Message {
// Deprecated: Use EventHead.ProtoReflect.Descriptor instead.
func (*EventHead) Descriptor() ([]byte, []int) {
return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{1}
return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{0}
}
func (x *EventHead) GetSlot() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot {
@ -180,7 +133,7 @@ type EventBlock struct {
func (x *EventBlock) Reset() {
*x = EventBlock{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_eth_v1_events_proto_msgTypes[2]
mi := &file_proto_eth_v1_events_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -193,7 +146,7 @@ func (x *EventBlock) String() string {
func (*EventBlock) ProtoMessage() {}
func (x *EventBlock) ProtoReflect() protoreflect.Message {
mi := &file_proto_eth_v1_events_proto_msgTypes[2]
mi := &file_proto_eth_v1_events_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -206,7 +159,7 @@ func (x *EventBlock) ProtoReflect() protoreflect.Message {
// Deprecated: Use EventBlock.ProtoReflect.Descriptor instead.
func (*EventBlock) Descriptor() ([]byte, []int) {
return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{2}
return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{1}
}
func (x *EventBlock) GetSlot() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot {
@ -248,7 +201,7 @@ type EventChainReorg struct {
func (x *EventChainReorg) Reset() {
*x = EventChainReorg{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_eth_v1_events_proto_msgTypes[3]
mi := &file_proto_eth_v1_events_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -261,7 +214,7 @@ func (x *EventChainReorg) String() string {
func (*EventChainReorg) ProtoMessage() {}
func (x *EventChainReorg) ProtoReflect() protoreflect.Message {
mi := &file_proto_eth_v1_events_proto_msgTypes[3]
mi := &file_proto_eth_v1_events_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -274,7 +227,7 @@ func (x *EventChainReorg) ProtoReflect() protoreflect.Message {
// Deprecated: Use EventChainReorg.ProtoReflect.Descriptor instead.
func (*EventChainReorg) Descriptor() ([]byte, []int) {
return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{3}
return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{2}
}
func (x *EventChainReorg) GetSlot() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot {
@ -347,7 +300,7 @@ type EventFinalizedCheckpoint struct {
func (x *EventFinalizedCheckpoint) Reset() {
*x = EventFinalizedCheckpoint{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_eth_v1_events_proto_msgTypes[4]
mi := &file_proto_eth_v1_events_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -360,7 +313,7 @@ func (x *EventFinalizedCheckpoint) String() string {
func (*EventFinalizedCheckpoint) ProtoMessage() {}
func (x *EventFinalizedCheckpoint) ProtoReflect() protoreflect.Message {
mi := &file_proto_eth_v1_events_proto_msgTypes[4]
mi := &file_proto_eth_v1_events_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -373,7 +326,7 @@ func (x *EventFinalizedCheckpoint) ProtoReflect() protoreflect.Message {
// Deprecated: Use EventFinalizedCheckpoint.ProtoReflect.Descriptor instead.
func (*EventFinalizedCheckpoint) Descriptor() ([]byte, []int) {
return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{4}
return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{3}
}
func (x *EventFinalizedCheckpoint) GetBlock() []byte {
@ -404,369 +357,6 @@ 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"`
Data *EventPayloadAttributeV1_BasePayloadAttribute `protobuf:"bytes,2,opt,name=data,proto3" json:"data,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) GetData() *EventPayloadAttributeV1_BasePayloadAttribute {
if x != nil {
return x.Data
}
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"`
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 EventBlobSidecar struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
BlockRoot []byte `protobuf:"bytes,1,opt,name=block_root,json=blockRoot,proto3" json:"block_root,omitempty" ssz-size:"32"`
Index uint64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
Slot github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=slot,proto3" json:"slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"`
VersionedHash []byte `protobuf:"bytes,4,opt,name=versioned_hash,json=versionedHash,proto3" json:"versioned_hash,omitempty" ssz-size:"32"`
KzgCommitment []byte `protobuf:"bytes,5,opt,name=kzg_commitment,json=kzgCommitment,proto3" json:"kzg_commitment,omitempty" ssz-size:"48"`
}
func (x *EventBlobSidecar) Reset() {
*x = EventBlobSidecar{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_eth_v1_events_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EventBlobSidecar) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EventBlobSidecar) ProtoMessage() {}
func (x *EventBlobSidecar) 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 {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EventBlobSidecar.ProtoReflect.Descriptor instead.
func (*EventBlobSidecar) Descriptor() ([]byte, []int) {
return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{7}
}
func (x *EventBlobSidecar) GetBlockRoot() []byte {
if x != nil {
return x.BlockRoot
}
return nil
}
func (x *EventBlobSidecar) GetIndex() uint64 {
if x != nil {
return x.Index
}
return 0
}
func (x *EventBlobSidecar) GetSlot() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot {
if x != nil {
return x.Slot
}
return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot(0)
}
func (x *EventBlobSidecar) GetVersionedHash() []byte {
if x != nil {
return x.VersionedHash
}
return nil
}
func (x *EventBlobSidecar) GetKzgCommitment() []byte {
if x != nil {
return x.KzgCommitment
}
return nil
}
type EventPayloadAttributeV1_BasePayloadAttribute struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ProposalSlot github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=proposal_slot,json=proposalSlot,proto3" json:"proposal_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/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_v4_consensus_types_primitives.ValidatorIndex `protobuf:"varint,7,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"`
PayloadAttributes *v1.PayloadAttributes `protobuf:"bytes,8,opt,name=payload_attributes,json=payloadAttributes,proto3" json:"payload_attributes,omitempty"`
}
func (x *EventPayloadAttributeV1_BasePayloadAttribute) Reset() {
*x = EventPayloadAttributeV1_BasePayloadAttribute{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_eth_v1_events_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EventPayloadAttributeV1_BasePayloadAttribute) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EventPayloadAttributeV1_BasePayloadAttribute) ProtoMessage() {}
func (x *EventPayloadAttributeV1_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 mi.MessageOf(x)
}
// 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 *EventPayloadAttributeV1_BasePayloadAttribute) GetProposalSlot() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot {
if x != nil {
return x.ProposalSlot
}
return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot(0)
}
func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetParentBlockNumber() uint64 {
if x != nil {
return x.ParentBlockNumber
}
return 0
}
func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetParentBlockRoot() []byte {
if x != nil {
return x.ParentBlockRoot
}
return nil
}
func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetParentBlockHash() []byte {
if x != nil {
return x.ParentBlockHash
}
return nil
}
func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetProposerIndex() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex {
if x != nil {
return x.ProposerIndex
}
return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex(0)
}
func (x *EventPayloadAttributeV1_BasePayloadAttribute) GetPayloadAttributes() *v1.PayloadAttributes {
if x != nil {
return x.PayloadAttributes
}
return nil
}
type EventPayloadAttributeV2_BasePayloadAttribute struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ProposalSlot github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot `protobuf:"varint,3,opt,name=proposal_slot,json=proposalSlot,proto3" json:"proposal_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/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_v4_consensus_types_primitives.ValidatorIndex `protobuf:"varint,7,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"`
PayloadAttributes *v1.PayloadAttributesV2 `protobuf:"bytes,8,opt,name=payload_attributes,json=payloadAttributes,proto3" json:"payload_attributes,omitempty"`
}
func (x *EventPayloadAttributeV2_BasePayloadAttribute) Reset() {
*x = EventPayloadAttributeV2_BasePayloadAttribute{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_eth_v1_events_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
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[9]
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_BasePayloadAttribute.ProtoReflect.Descriptor instead.
func (*EventPayloadAttributeV2_BasePayloadAttribute) Descriptor() ([]byte, []int) {
return file_proto_eth_v1_events_proto_rawDescGZIP(), []int{6, 0}
}
func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetProposalSlot() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot {
if x != nil {
return x.ProposalSlot
}
return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot(0)
}
func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetParentBlockNumber() uint64 {
if x != nil {
return x.ParentBlockNumber
}
return 0
}
func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetParentBlockRoot() []byte {
if x != nil {
return x.ParentBlockRoot
}
return nil
}
func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetParentBlockHash() []byte {
if x != nil {
return x.ParentBlockHash
}
return nil
}
func (x *EventPayloadAttributeV2_BasePayloadAttribute) GetProposerIndex() github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex {
if x != nil {
return x.ProposerIndex
}
return github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex(0)
}
func (x *EventPayloadAttributeV2_BasePayloadAttribute) 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{
@ -779,194 +369,96 @@ var file_proto_eth_v1_events_proto_rawDesc = []byte{
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, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d,
0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73,
0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 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, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e,
0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74,
0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12,
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, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e,
0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74,
0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12,
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, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45,
0x70, 0x6f, 0x63, 0x68, 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, 0x34, 0x2f, 0x63, 0x6f,
0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72,
0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 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, 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,
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, 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,
0x6f, 0x74, 0x6f, 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, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73,
0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65,
0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 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, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65,
0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69,
0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74,
0x12, 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, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65,
0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69,
0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74,
0x12, 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, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74,
0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e,
0x45, 0x70, 0x6f, 0x63, 0x68, 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, 0x34, 0x2f, 0x63,
0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70,
0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 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, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73,
0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69,
0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 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, 0x34, 0x2f, 0x63, 0x6f,
0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72,
0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 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, 0xf3, 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, 0xea, 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, 0x34, 0x2f, 0x63, 0x6f, 0x6e,
0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69,
0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 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,
0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c,
0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 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, 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,
0x11, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
0x65, 0x73, 0x22, 0x88, 0x02, 0x0a, 0x10, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x62,
0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18,
0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x14,
0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69,
0x6e, 0x64, 0x65, 0x78, 0x12, 0x59, 0x0a, 0x04, 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, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e,
0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74,
0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12,
0x2d, 0x0a, 0x0e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x5f, 0x68, 0x61, 0x73,
0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52,
0x0d, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2d,
0x0a, 0x0e, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74,
0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0d,
0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 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, 0x34, 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,
0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 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 (
@ -981,31 +473,19 @@ 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, 10)
var file_proto_eth_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
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
(*EventBlobSidecar)(nil), // 7: ethereum.eth.v1.EventBlobSidecar
(*EventPayloadAttributeV1_BasePayloadAttribute)(nil), // 8: ethereum.eth.v1.EventPayloadAttributeV1.BasePayloadAttribute
(*EventPayloadAttributeV2_BasePayloadAttribute)(nil), // 9: ethereum.eth.v1.EventPayloadAttributeV2.BasePayloadAttribute
(*v1.PayloadAttributes)(nil), // 10: ethereum.engine.v1.PayloadAttributes
(*v1.PayloadAttributesV2)(nil), // 11: ethereum.engine.v1.PayloadAttributesV2
(*EventHead)(nil), // 0: ethereum.eth.v1.EventHead
(*EventBlock)(nil), // 1: ethereum.eth.v1.EventBlock
(*EventChainReorg)(nil), // 2: ethereum.eth.v1.EventChainReorg
(*EventFinalizedCheckpoint)(nil), // 3: ethereum.eth.v1.EventFinalizedCheckpoint
}
var file_proto_eth_v1_events_proto_depIdxs = []int32{
8, // 0: ethereum.eth.v1.EventPayloadAttributeV1.data:type_name -> ethereum.eth.v1.EventPayloadAttributeV1.BasePayloadAttribute
9, // 1: ethereum.eth.v1.EventPayloadAttributeV2.data:type_name -> ethereum.eth.v1.EventPayloadAttributeV2.BasePayloadAttribute
10, // 2: ethereum.eth.v1.EventPayloadAttributeV1.BasePayloadAttribute.payload_attributes:type_name -> ethereum.engine.v1.PayloadAttributes
11, // 3: ethereum.eth.v1.EventPayloadAttributeV2.BasePayloadAttribute.payload_attributes: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
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
}
func init() { file_proto_eth_v1_events_proto_init() }
@ -1015,18 +495,6 @@ func file_proto_eth_v1_events_proto_init() {
}
if !protoimpl.UnsafeEnabled {
file_proto_eth_v1_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StreamEventsRequest); 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[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EventHead); i {
case 0:
return &v.state
@ -1038,7 +506,7 @@ func file_proto_eth_v1_events_proto_init() {
return nil
}
}
file_proto_eth_v1_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_proto_eth_v1_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EventBlock); i {
case 0:
return &v.state
@ -1050,7 +518,7 @@ func file_proto_eth_v1_events_proto_init() {
return nil
}
}
file_proto_eth_v1_events_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_proto_eth_v1_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EventChainReorg); i {
case 0:
return &v.state
@ -1062,7 +530,7 @@ func file_proto_eth_v1_events_proto_init() {
return nil
}
}
file_proto_eth_v1_events_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_proto_eth_v1_events_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EventFinalizedCheckpoint); i {
case 0:
return &v.state
@ -1074,66 +542,6 @@ 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
}
}
file_proto_eth_v1_events_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EventBlobSidecar); 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.(*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[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EventPayloadAttributeV2_BasePayloadAttribute); 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{
@ -1141,7 +549,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: 10,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -26,12 +26,6 @@ option java_outer_classname = "BeaconEventsProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
message StreamEventsRequest {
// List of topics to request for event streaming items. Allowed request topics are
// head, attestation, block, voluntary_exit, finalized_checkpoint, chain_reorg.
repeated string topics = 1;
}
message EventHead {
// Slot of the new chain head.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
@ -104,70 +98,4 @@ message EventFinalizedCheckpoint {
// Information about optimistic sync.
bool execution_optimistic = 4;
}
message EventPayloadAttributeV1 {
// 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/v4/consensus-types/primitives.Slot"];
// 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.
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/v4/consensus-types/primitives.ValidatorIndex"];
// payload_attributes: beacon API encoding of PayloadAttributesV<N> 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 = 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/v4/consensus-types/primitives.Slot"];
// 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.
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/v4/consensus-types/primitives.ValidatorIndex"];
// payload_attributes: beacon API encoding of PayloadAttributesV<N> 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 = 8;
}
}
message EventBlobSidecar {
bytes block_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 index = 2;
uint64 slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
// calculated from the kzg commitment
bytes versioned_hash = 4 [(ethereum.eth.ext.ssz_size) = "32"];
bytes kzg_commitment = 5 [(ethereum.eth.ext.ssz_size) = "48"];
}

View File

@ -57,7 +57,6 @@ common_deps = [
"//crypto/bls:go_default_library",
"//encoding/bytesutil:go_default_library",
"//io/file:go_default_library",
"//proto/eth/service:go_default_library",
"//proto/eth/v1:go_default_library",
"//math:go_default_library",
"//proto/engine/v1:go_default_library",

View File

@ -11,19 +11,15 @@ go_library(
"beacon_service_mock.go",
"beacon_validator_client_mock.go",
"beacon_validator_server_mock.go",
"event_service_mock.go",
"keymanager_mock.go",
"node_service_mock.go",
],
importpath = "github.com/prysmaticlabs/prysm/v4/testing/mock",
visibility = ["//visibility:public"],
deps = [
"//proto/eth/service:go_default_library",
"//proto/eth/v1:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//proto/prysm/v1alpha1/validator-client:go_default_library",
"@com_github_golang_mock//gomock:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//metadata:go_default_library",
"@org_golang_google_protobuf//types/known/emptypb:go_default_library",

View File

@ -1,302 +0,0 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/prysmaticlabs/prysm/v4/proto/eth/service (interfaces: EventsClient,Events_StreamEventsClient,Events_StreamEventsServer)
// Package mock is a generated GoMock package.
package mock
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
gateway "github.com/grpc-ecosystem/grpc-gateway/v2/proto/gateway"
service "github.com/prysmaticlabs/prysm/v4/proto/eth/service"
v1 "github.com/prysmaticlabs/prysm/v4/proto/eth/v1"
grpc "google.golang.org/grpc"
metadata "google.golang.org/grpc/metadata"
)
// MockEventsClient is a mock of EventsClient interface.
type EventsClient struct {
ctrl *gomock.Controller
recorder *EventsClientMockRecorder
}
// MockEventsClientMockRecorder is the mock recorder for MockEventsClient.
type EventsClientMockRecorder struct {
mock *EventsClient
}
// NewMockEventsClient creates a new mock instance.
func NewMockEventsClient(ctrl *gomock.Controller) *EventsClient {
mock := &EventsClient{ctrl: ctrl}
mock.recorder = &EventsClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *EventsClient) EXPECT() *EventsClientMockRecorder {
return m.recorder
}
// StreamEvents mocks base method.
func (m *EventsClient) StreamEvents(arg0 context.Context, arg1 *v1.StreamEventsRequest, arg2 ...grpc.CallOption) (service.Events_StreamEventsClient, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "StreamEvents", varargs...)
ret0, _ := ret[0].(service.Events_StreamEventsClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// StreamEvents indicates an expected call of StreamEvents.
func (mr *EventsClientMockRecorder) StreamEvents(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamEvents", reflect.TypeOf((*EventsClient)(nil).StreamEvents), varargs...)
}
// MockEvents_StreamEventsClient is a mock of Events_StreamEventsClient interface.
type Events_StreamEventsClient struct {
ctrl *gomock.Controller
recorder *Events_StreamEventsClientMockRecorder
}
// MockEvents_StreamEventsClientMockRecorder is the mock recorder for MockEvents_StreamEventsClient.
type Events_StreamEventsClientMockRecorder struct {
mock *Events_StreamEventsClient
}
// NewMockEvents_StreamEventsClient creates a new mock instance.
func NewMockEvents_StreamEventsClient(ctrl *gomock.Controller) *Events_StreamEventsClient {
mock := &Events_StreamEventsClient{ctrl: ctrl}
mock.recorder = &Events_StreamEventsClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *Events_StreamEventsClient) EXPECT() *Events_StreamEventsClientMockRecorder {
return m.recorder
}
// CloseSend mocks base method.
func (m *Events_StreamEventsClient) CloseSend() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseSend")
ret0, _ := ret[0].(error)
return ret0
}
// CloseSend indicates an expected call of CloseSend.
func (mr *Events_StreamEventsClientMockRecorder) CloseSend() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*Events_StreamEventsClient)(nil).CloseSend))
}
// Context mocks base method.
func (m *Events_StreamEventsClient) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *Events_StreamEventsClientMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*Events_StreamEventsClient)(nil).Context))
}
// Header mocks base method.
func (m *Events_StreamEventsClient) Header() (metadata.MD, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Header")
ret0, _ := ret[0].(metadata.MD)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Header indicates an expected call of Header.
func (mr *Events_StreamEventsClientMockRecorder) Header() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*Events_StreamEventsClient)(nil).Header))
}
// Recv mocks base method.
func (m *Events_StreamEventsClient) Recv() (*gateway.EventSource, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*gateway.EventSource)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *Events_StreamEventsClientMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*Events_StreamEventsClient)(nil).Recv))
}
// RecvMsg mocks base method.
func (m *Events_StreamEventsClient) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *Events_StreamEventsClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*Events_StreamEventsClient)(nil).RecvMsg), arg0)
}
// SendMsg mocks base method.
func (m *Events_StreamEventsClient) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *Events_StreamEventsClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*Events_StreamEventsClient)(nil).SendMsg), arg0)
}
// Trailer mocks base method.
func (m *Events_StreamEventsClient) Trailer() metadata.MD {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Trailer")
ret0, _ := ret[0].(metadata.MD)
return ret0
}
// Trailer indicates an expected call of Trailer.
func (mr *Events_StreamEventsClientMockRecorder) Trailer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*Events_StreamEventsClient)(nil).Trailer))
}
// MockEvents_StreamEventsServer is a mock of Events_StreamEventsServer interface.
type Events_StreamEventsServer struct {
ctrl *gomock.Controller
recorder *Events_StreamEventsServerMockRecorder
}
// MockEvents_StreamEventsServerMockRecorder is the mock recorder for MockEvents_StreamEventsServer.
type Events_StreamEventsServerMockRecorder struct {
mock *Events_StreamEventsServer
}
// NewMockEvents_StreamEventsServer creates a new mock instance.
func NewMockEvents_StreamEventsServer(ctrl *gomock.Controller) *Events_StreamEventsServer {
mock := &Events_StreamEventsServer{ctrl: ctrl}
mock.recorder = &Events_StreamEventsServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *Events_StreamEventsServer) EXPECT() *Events_StreamEventsServerMockRecorder {
return m.recorder
}
// Context mocks base method.
func (m *Events_StreamEventsServer) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *Events_StreamEventsServerMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*Events_StreamEventsServer)(nil).Context))
}
// RecvMsg mocks base method.
func (m *Events_StreamEventsServer) RecvMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *Events_StreamEventsServerMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*Events_StreamEventsServer)(nil).RecvMsg), arg0)
}
// Send mocks base method.
func (m *Events_StreamEventsServer) Send(arg0 *gateway.EventSource) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *Events_StreamEventsServerMockRecorder) Send(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*Events_StreamEventsServer)(nil).Send), arg0)
}
// SendHeader mocks base method.
func (m *Events_StreamEventsServer) SendHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendHeader indicates an expected call of SendHeader.
func (mr *Events_StreamEventsServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*Events_StreamEventsServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m *Events_StreamEventsServer) SendMsg(arg0 interface{}) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *Events_StreamEventsServerMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*Events_StreamEventsServer)(nil).SendMsg), arg0)
}
// SetHeader mocks base method.
func (m *Events_StreamEventsServer) SetHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetHeader indicates an expected call of SetHeader.
func (mr *Events_StreamEventsServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*Events_StreamEventsServer)(nil).SetHeader), arg0)
}
// SetTrailer mocks base method.
func (m *Events_StreamEventsServer) SetTrailer(arg0 metadata.MD) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetTrailer", arg0)
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *Events_StreamEventsServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*Events_StreamEventsServer)(nil).SetTrailer), arg0)
}

View File

@ -5,6 +5,19 @@ import (
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
)
// HydrateSignedBlobSidecar hydrates a signed blob sidecar with correct field length sizes
// to comply with SSZ marshalling and unmarshalling rules.
func HydrateSignedBlobSidecar(b *ethpb.SignedBlobSidecar) *ethpb.SignedBlobSidecar {
if b.Signature == nil {
b.Signature = make([]byte, fieldparams.BLSSignatureLength)
}
if b.Message == nil {
b.Message = &ethpb.DeprecatedBlobSidecar{}
}
b.Message = HydrateBlobSidecar(b.Message)
return b
}
// HydrateBlobSidecar hydrates a blob sidecar with correct field length sizes
// to comply with SSZ marshalling and unmarshalling rules.
func HydrateBlobSidecar(b *ethpb.DeprecatedBlobSidecar) *ethpb.DeprecatedBlobSidecar {
@ -32,6 +45,9 @@ func HydrateSignedBlindedBlobSidecar(b *ethpb.SignedBlindedBlobSidecar) *ethpb.S
if b.Signature == nil {
b.Signature = make([]byte, fieldparams.BLSSignatureLength)
}
if b.Message == nil {
b.Message = &ethpb.BlindedBlobSidecar{}
}
b.Message = HydrateBlindedBlobSidecar(b.Message)
return b
}