mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 23:48:06 -05:00
Beacon API: update Deneb endpoints after removing blob signing (#13235)
* making needed changes to beacon API based on removal of blobsidecar from block contents * fixing tests and reverting some changes to be addressed later * fixing generated code from protos * gaz * fixing get blob handler and adding blob storage to the blob service * updating unit tests * WIP * wip tests * got tests passing but needs cleanup * removing gomod and gosum changes * fixing more tests * fixing more tests * fixing more tests * gaz * moving some proto types around * removing unneeded unit test * fixing proposer paths * adding more tests * fixing more tests * improving more unit tests * updating one blob only unit test * changing arguments of buildBlobSidecar * reverting a change based on feedback * terence's review items * fixing test based on new develop changes * radek's comments * addressed more comments from radek * adding in blobs to test data * fixing casing in test * removing extra line * fixing issue from bad merge * Update beacon-chain/rpc/eth/beacon/handlers_test.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/rpc/eth/beacon/handlers_test.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/rpc/eth/beacon/handlers_test.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/rpc/eth/blob/handlers.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * moving core getblob business logic to blocker based on radek's comment * fixing mock blocker * gaz --------- Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
@@ -58,7 +58,6 @@ type ReadOnlyDatabase interface {
|
|||||||
// Blob operations.
|
// Blob operations.
|
||||||
BlobSidecarsByRoot(ctx context.Context, beaconBlockRoot [32]byte, indices ...uint64) ([]*ethpb.DeprecatedBlobSidecar, error)
|
BlobSidecarsByRoot(ctx context.Context, beaconBlockRoot [32]byte, indices ...uint64) ([]*ethpb.DeprecatedBlobSidecar, error)
|
||||||
BlobSidecarsBySlot(ctx context.Context, slot primitives.Slot, indices ...uint64) ([]*ethpb.DeprecatedBlobSidecar, error)
|
BlobSidecarsBySlot(ctx context.Context, slot primitives.Slot, indices ...uint64) ([]*ethpb.DeprecatedBlobSidecar, error)
|
||||||
|
|
||||||
// origin checkpoint sync support
|
// origin checkpoint sync support
|
||||||
OriginCheckpointBlockRoot(ctx context.Context) ([32]byte, error)
|
OriginCheckpointBlockRoot(ctx context.Context) ([32]byte, error)
|
||||||
BackfillBlockRoot(ctx context.Context) ([32]byte, error)
|
BackfillBlockRoot(ctx context.Context) ([32]byte, error)
|
||||||
@@ -95,7 +94,6 @@ type NoHeadAccessDatabase interface {
|
|||||||
SaveRegistrationsByValidatorIDs(ctx context.Context, ids []primitives.ValidatorIndex, regs []*ethpb.ValidatorRegistrationV1) error
|
SaveRegistrationsByValidatorIDs(ctx context.Context, ids []primitives.ValidatorIndex, regs []*ethpb.ValidatorRegistrationV1) error
|
||||||
|
|
||||||
// Blob operations.
|
// Blob operations.
|
||||||
SaveBlobSidecar(ctx context.Context, sidecars []*ethpb.DeprecatedBlobSidecar) error
|
|
||||||
DeleteBlobSidecars(ctx context.Context, beaconBlockRoot [32]byte) error
|
DeleteBlobSidecars(ctx context.Context, beaconBlockRoot [32]byte) error
|
||||||
|
|
||||||
CleanUpDirtyStates(ctx context.Context, slotsPerArchivedPoint primitives.Slot) error
|
CleanUpDirtyStates(ctx context.Context, slotsPerArchivedPoint primitives.Slot) error
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ func (s *Store) SaveBlobSidecar(ctx context.Context, scs []*ethpb.DeprecatedBlob
|
|||||||
var prune []blobRotatingKey
|
var prune []blobRotatingKey
|
||||||
return s.db.Update(func(tx *bolt.Tx) error {
|
return s.db.Update(func(tx *bolt.Tx) error {
|
||||||
var existing []byte
|
var existing []byte
|
||||||
sc := ðpb.BlobSidecars{}
|
sc := ðpb.DeprecatedBlobSidecars{}
|
||||||
bkt := tx.Bucket(blobsBucket)
|
bkt := tx.Bucket(blobsBucket)
|
||||||
c := bkt.Cursor()
|
c := bkt.Cursor()
|
||||||
for k, v := c.Seek(prefix); bytes.HasPrefix(k, prefix); k, v = c.Next() {
|
for k, v := c.Seek(prefix); bytes.HasPrefix(k, prefix); k, v = c.Next() {
|
||||||
@@ -198,7 +198,7 @@ func (s *Store) BlobSidecarsByRoot(ctx context.Context, root [32]byte, indices .
|
|||||||
if enc == nil {
|
if enc == nil {
|
||||||
return nil, ErrNotFound
|
return nil, ErrNotFound
|
||||||
}
|
}
|
||||||
sc := ðpb.BlobSidecars{}
|
sc := ðpb.DeprecatedBlobSidecars{}
|
||||||
if err := decode(ctx, enc, sc); err != nil {
|
if err := decode(ctx, enc, sc); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -206,7 +206,7 @@ func (s *Store) BlobSidecarsByRoot(ctx context.Context, root [32]byte, indices .
|
|||||||
return filterForIndices(sc, indices...)
|
return filterForIndices(sc, indices...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func filterForIndices(sc *ethpb.BlobSidecars, indices ...uint64) ([]*ethpb.DeprecatedBlobSidecar, error) {
|
func filterForIndices(sc *ethpb.DeprecatedBlobSidecars, indices ...uint64) ([]*ethpb.DeprecatedBlobSidecar, error) {
|
||||||
if len(indices) == 0 {
|
if len(indices) == 0 {
|
||||||
return sc.Sidecars, nil
|
return sc.Sidecars, nil
|
||||||
}
|
}
|
||||||
@@ -252,7 +252,7 @@ func (s *Store) BlobSidecarsBySlot(ctx context.Context, slot types.Slot, indices
|
|||||||
if enc == nil {
|
if enc == nil {
|
||||||
return nil, ErrNotFound
|
return nil, ErrNotFound
|
||||||
}
|
}
|
||||||
sc := ðpb.BlobSidecars{}
|
sc := ðpb.DeprecatedBlobSidecars{}
|
||||||
if err := decode(ctx, enc, sc); err != nil {
|
if err := decode(ctx, enc, sc); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ func BenchmarkStore_BlobSidecarsByRoot(b *testing.B) {
|
|||||||
{BlockRoot: r, Slot: primitives.Slot(i)},
|
{BlockRoot: r, Slot: primitives.Slot(i)},
|
||||||
}
|
}
|
||||||
k := s.blobSidecarKey(scs[0])
|
k := s.blobSidecarKey(scs[0])
|
||||||
encodedBlobSidecar, err := encode(ctx, ðpb.BlobSidecars{Sidecars: scs})
|
encodedBlobSidecar, err := encode(ctx, ðpb.DeprecatedBlobSidecars{Sidecars: scs})
|
||||||
require.NoError(b, err)
|
require.NoError(b, err)
|
||||||
require.NoError(b, bkt.Put(k, encodedBlobSidecar))
|
require.NoError(b, bkt.Put(k, encodedBlobSidecar))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -874,6 +874,7 @@ func (b *BeaconNode) registerRPCService(router *mux.Router) error {
|
|||||||
BlockBuilder: b.fetchBuilderService(),
|
BlockBuilder: b.fetchBuilderService(),
|
||||||
Router: router,
|
Router: router,
|
||||||
ClockWaiter: b.clockWaiter,
|
ClockWaiter: b.clockWaiter,
|
||||||
|
BlobStorage: b.BlobStorage,
|
||||||
})
|
})
|
||||||
|
|
||||||
return b.services.RegisterService(rpcService)
|
return b.services.RegisterService(rpcService)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ go_library(
|
|||||||
"//beacon-chain/core/feed/operation:go_default_library",
|
"//beacon-chain/core/feed/operation:go_default_library",
|
||||||
"//beacon-chain/core/feed/state:go_default_library",
|
"//beacon-chain/core/feed/state:go_default_library",
|
||||||
"//beacon-chain/db:go_default_library",
|
"//beacon-chain/db:go_default_library",
|
||||||
|
"//beacon-chain/db/filesystem:go_default_library",
|
||||||
"//beacon-chain/execution:go_default_library",
|
"//beacon-chain/execution:go_default_library",
|
||||||
"//beacon-chain/operations/attestations:go_default_library",
|
"//beacon-chain/operations/attestations:go_default_library",
|
||||||
"//beacon-chain/operations/blstoexec:go_default_library",
|
"//beacon-chain/operations/blstoexec:go_default_library",
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const (
|
|||||||
Internal = iota
|
Internal = iota
|
||||||
Unavailable
|
Unavailable
|
||||||
BadRequest
|
BadRequest
|
||||||
|
NotFound
|
||||||
// Add more errors as needed
|
// Add more errors as needed
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -28,6 +29,8 @@ func ErrorReasonToGRPC(reason ErrorReason) codes.Code {
|
|||||||
return codes.Unavailable
|
return codes.Unavailable
|
||||||
case BadRequest:
|
case BadRequest:
|
||||||
return codes.InvalidArgument
|
return codes.InvalidArgument
|
||||||
|
case NotFound:
|
||||||
|
return codes.NotFound
|
||||||
// Add more cases for other error reasons as needed
|
// Add more cases for other error reasons as needed
|
||||||
default:
|
default:
|
||||||
return codes.Internal
|
return codes.Internal
|
||||||
@@ -42,6 +45,8 @@ func ErrorReasonToHTTP(reason ErrorReason) int {
|
|||||||
return http.StatusServiceUnavailable
|
return http.StatusServiceUnavailable
|
||||||
case BadRequest:
|
case BadRequest:
|
||||||
return http.StatusBadRequest
|
return http.StatusBadRequest
|
||||||
|
case NotFound:
|
||||||
|
return http.StatusNotFound
|
||||||
// Add more cases for other error reasons as needed
|
// Add more cases for other error reasons as needed
|
||||||
default:
|
default:
|
||||||
return http.StatusInternalServerError
|
return http.StatusInternalServerError
|
||||||
|
|||||||
@@ -998,11 +998,11 @@ func (s *Server) publishBlindedBlockSSZ(ctx context.Context, w http.ResponseWrit
|
|||||||
http2.HandleError(w, "Could not read request body: "+err.Error(), http.StatusInternalServerError)
|
http2.HandleError(w, "Could not read request body: "+err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
denebBlockContents := ð.SignedBlindedBeaconBlockAndBlobsDeneb{}
|
denebBlock := ð.SignedBlindedBeaconBlockDeneb{}
|
||||||
if err := denebBlockContents.UnmarshalSSZ(body); err == nil {
|
if err := denebBlock.UnmarshalSSZ(body); err == nil {
|
||||||
genericBlock := ð.GenericSignedBeaconBlock{
|
genericBlock := ð.GenericSignedBeaconBlock{
|
||||||
Block: ð.GenericSignedBeaconBlock_BlindedDeneb{
|
Block: ð.GenericSignedBeaconBlock_BlindedDeneb{
|
||||||
BlindedDeneb: denebBlockContents,
|
BlindedDeneb: denebBlock,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if err = s.validateBroadcast(ctx, r, genericBlock); err != nil {
|
if err = s.validateBroadcast(ctx, r, genericBlock); err != nil {
|
||||||
@@ -1081,9 +1081,9 @@ func (s *Server) publishBlindedBlock(ctx context.Context, w http.ResponseWriter,
|
|||||||
}
|
}
|
||||||
versionHeader := r.Header.Get(api.VersionHeader)
|
versionHeader := r.Header.Get(api.VersionHeader)
|
||||||
var blockVersionError string
|
var blockVersionError string
|
||||||
var denebBlockContents *shared.SignedBlindedBeaconBlockContentsDeneb
|
var denebBlock *shared.SignedBlindedBeaconBlockDeneb
|
||||||
if err = unmarshalStrict(body, &denebBlockContents); err == nil {
|
if err = unmarshalStrict(body, &denebBlock); err == nil {
|
||||||
consensusBlock, err := denebBlockContents.ToGeneric()
|
consensusBlock, err := denebBlock.ToGeneric()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if err = s.validateBroadcast(ctx, r, consensusBlock); err != nil {
|
if err = s.validateBroadcast(ctx, r, consensusBlock); err != nil {
|
||||||
http2.HandleError(w, err.Error(), http.StatusBadRequest)
|
http2.HandleError(w, err.Error(), http.StatusBadRequest)
|
||||||
@@ -1215,11 +1215,11 @@ func (s *Server) publishBlockSSZ(ctx context.Context, w http.ResponseWriter, r *
|
|||||||
http2.HandleError(w, "Could not read request body", http.StatusInternalServerError)
|
http2.HandleError(w, "Could not read request body", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
denebBlockContents := ð.SignedBeaconBlockDeneb{}
|
denebBlock := ð.SignedBeaconBlockContentsDeneb{}
|
||||||
if err := denebBlockContents.UnmarshalSSZ(body); err == nil {
|
if err := denebBlock.UnmarshalSSZ(body); err == nil {
|
||||||
genericBlock := ð.GenericSignedBeaconBlock{
|
genericBlock := ð.GenericSignedBeaconBlock{
|
||||||
Block: ð.GenericSignedBeaconBlock_Deneb{
|
Block: ð.GenericSignedBeaconBlock_Deneb{
|
||||||
Deneb: denebBlockContents,
|
Deneb: denebBlock,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if err = s.validateBroadcast(ctx, r, genericBlock); err != nil {
|
if err = s.validateBroadcast(ctx, r, genericBlock); err != nil {
|
||||||
|
|||||||
@@ -1082,20 +1082,20 @@ func TestPublishBlock(t *testing.T) {
|
|||||||
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
||||||
v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
||||||
block, ok := req.Block.(*eth.GenericSignedBeaconBlock_Deneb)
|
block, ok := req.Block.(*eth.GenericSignedBeaconBlock_Deneb)
|
||||||
converted, err := shared.BeaconBlockDenebFromConsensus(block.Deneb.Block)
|
converted, err := shared.SignedBeaconBlockContentsDenebFromConsensus(block.Deneb)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
var signedblock *shared.SignedBeaconBlockContentsDeneb
|
var signedblock *shared.SignedBeaconBlockContentsDeneb
|
||||||
err = json.Unmarshal([]byte(rpctesting.DenebBlockContents), &signedblock)
|
err = json.Unmarshal([]byte(rpctesting.DenebBlockContents), &signedblock)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.DeepEqual(t, converted, signedblock.SignedBlock.Message)
|
require.DeepEqual(t, converted, signedblock)
|
||||||
return ok
|
return ok
|
||||||
}))
|
}))
|
||||||
server := &Server{
|
server := &Server{
|
||||||
V1Alpha1ValidatorServer: v1alpha1Server,
|
V1Alpha1ValidatorServer: v1alpha1Server,
|
||||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||||
}
|
}
|
||||||
|
|
||||||
request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.DenebBlockContents)))
|
request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.DenebBlockContents)))
|
||||||
|
request.Header.Set(api.VersionHeader, version.String(version.Deneb))
|
||||||
writer := httptest.NewRecorder()
|
writer := httptest.NewRecorder()
|
||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
server.PublishBlock(writer, request)
|
server.PublishBlock(writer, request)
|
||||||
@@ -1199,33 +1199,29 @@ func TestPublishBlockSSZ(t *testing.T) {
|
|||||||
assert.Equal(t, http.StatusOK, writer.Code)
|
assert.Equal(t, http.StatusOK, writer.Code)
|
||||||
})
|
})
|
||||||
t.Run("Deneb", func(t *testing.T) {
|
t.Run("Deneb", func(t *testing.T) {
|
||||||
// TODO: Fix this as part of beacon API changes
|
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
||||||
|
v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
||||||
|
_, ok := req.Block.(*eth.GenericSignedBeaconBlock_Deneb)
|
||||||
|
return ok
|
||||||
|
}))
|
||||||
|
server := &Server{
|
||||||
|
V1Alpha1ValidatorServer: v1alpha1Server,
|
||||||
|
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||||
|
}
|
||||||
|
|
||||||
//v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
var dblock shared.SignedBeaconBlockContentsDeneb
|
||||||
//v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
err := json.Unmarshal([]byte(rpctesting.DenebBlockContents), &dblock)
|
||||||
// _, ok := req.Block.(*eth.GenericSignedBeaconBlock_Deneb)
|
require.NoError(t, err)
|
||||||
// return ok
|
genericBlock, err := dblock.ToGeneric()
|
||||||
//}))
|
require.NoError(t, err)
|
||||||
//server := &Server{
|
sszvalue, err := genericBlock.GetDeneb().MarshalSSZ()
|
||||||
// V1Alpha1ValidatorServer: v1alpha1Server,
|
require.NoError(t, err)
|
||||||
// SyncChecker: &mockSync.Sync{IsSyncing: false},
|
request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader(sszvalue))
|
||||||
//}
|
request.Header.Set("Accept", api.OctetStreamMediaType)
|
||||||
//
|
writer := httptest.NewRecorder()
|
||||||
//var dblock shared.SignedBeaconBlockContentsDeneb
|
writer.Body = &bytes.Buffer{}
|
||||||
//err := json.Unmarshal([]byte(rpctesting.DenebBlockContents), &dblock)
|
server.PublishBlock(writer, request)
|
||||||
//require.NoError(t, err)
|
assert.Equal(t, http.StatusOK, writer.Code)
|
||||||
//genericBlock, err := dblock.ToGeneric()
|
|
||||||
//require.NoError(t, err)
|
|
||||||
//v2block, err := migration.V1Alpha1SignedBeaconBlockDenebAndBlobsToV2(genericBlock.GetDeneb())
|
|
||||||
//require.NoError(t, err)
|
|
||||||
//sszvalue, err := v2block.MarshalSSZ()
|
|
||||||
//require.NoError(t, err)
|
|
||||||
//request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader(sszvalue))
|
|
||||||
//request.Header.Set("Accept", "application/octet-stream")
|
|
||||||
//writer := httptest.NewRecorder()
|
|
||||||
//writer.Body = &bytes.Buffer{}
|
|
||||||
//server.PublishBlock(writer, request)
|
|
||||||
//assert.Equal(t, http.StatusOK, writer.Code)
|
|
||||||
})
|
})
|
||||||
t.Run("invalid block", func(t *testing.T) {
|
t.Run("invalid block", func(t *testing.T) {
|
||||||
server := &Server{
|
server := &Server{
|
||||||
@@ -1339,12 +1335,12 @@ func TestPublishBlindedBlock(t *testing.T) {
|
|||||||
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
||||||
v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
||||||
block, ok := req.Block.(*eth.GenericSignedBeaconBlock_BlindedDeneb)
|
block, ok := req.Block.(*eth.GenericSignedBeaconBlock_BlindedDeneb)
|
||||||
converted, err := shared.BlindedBeaconBlockDenebFromConsensus(block.BlindedDeneb.SignedBlindedBlock.Message)
|
converted, err := shared.BlindedBeaconBlockDenebFromConsensus(block.BlindedDeneb.Message)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
var signedblock *shared.SignedBlindedBeaconBlockContentsDeneb
|
var signedblock *shared.SignedBlindedBeaconBlockDeneb
|
||||||
err = json.Unmarshal([]byte(rpctesting.BlindedDenebBlockContents), &signedblock)
|
err = json.Unmarshal([]byte(rpctesting.BlindedDenebBlock), &signedblock)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.DeepEqual(t, converted, signedblock.SignedBlindedBlock.Message)
|
require.DeepEqual(t, converted, signedblock.Message)
|
||||||
return ok
|
return ok
|
||||||
}))
|
}))
|
||||||
server := &Server{
|
server := &Server{
|
||||||
@@ -1352,7 +1348,7 @@ func TestPublishBlindedBlock(t *testing.T) {
|
|||||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||||
}
|
}
|
||||||
|
|
||||||
request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.BlindedDenebBlockContents)))
|
request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.BlindedDenebBlock)))
|
||||||
writer := httptest.NewRecorder()
|
writer := httptest.NewRecorder()
|
||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
server.PublishBlindedBlock(writer, request)
|
server.PublishBlindedBlock(writer, request)
|
||||||
@@ -1456,34 +1452,31 @@ func TestPublishBlindedBlockSSZ(t *testing.T) {
|
|||||||
server.PublishBlindedBlock(writer, request)
|
server.PublishBlindedBlock(writer, request)
|
||||||
assert.Equal(t, http.StatusOK, writer.Code)
|
assert.Equal(t, http.StatusOK, writer.Code)
|
||||||
})
|
})
|
||||||
// TODO: update this test when updating beacon apis
|
t.Run("Deneb", func(t *testing.T) {
|
||||||
//t.Run("Deneb", func(t *testing.T) {
|
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
||||||
// v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
||||||
// v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
_, ok := req.Block.(*eth.GenericSignedBeaconBlock_BlindedDeneb)
|
||||||
// _, ok := req.Block.(*eth.GenericSignedBeaconBlock_BlindedDeneb)
|
return ok
|
||||||
// return ok
|
}))
|
||||||
// }))
|
server := &Server{
|
||||||
// server := &Server{
|
V1Alpha1ValidatorServer: v1alpha1Server,
|
||||||
// V1Alpha1ValidatorServer: v1alpha1Server,
|
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||||
// SyncChecker: &mockSync.Sync{IsSyncing: false},
|
}
|
||||||
// }
|
|
||||||
//
|
var cblock shared.SignedBlindedBeaconBlockDeneb
|
||||||
// var cblock shared.SignedBlindedBeaconBlockContentsDeneb
|
err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlock), &cblock)
|
||||||
// err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlockContents), &cblock)
|
require.NoError(t, err)
|
||||||
// require.NoError(t, err)
|
genericBlock, err := cblock.ToGeneric()
|
||||||
// genericBlock, err := cblock.ToGeneric()
|
require.NoError(t, err)
|
||||||
// require.NoError(t, err)
|
sszvalue, err := genericBlock.GetBlindedDeneb().MarshalSSZ()
|
||||||
// v1block, err := migration.V1Alpha1SignedBlindedBlockAndBlobsDenebToV2Blinded(genericBlock.GetBlindedDeneb())
|
require.NoError(t, err)
|
||||||
// require.NoError(t, err)
|
request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader(sszvalue))
|
||||||
// sszvalue, err := v1block.MarshalSSZ()
|
request.Header.Set("Accept", api.OctetStreamMediaType)
|
||||||
// require.NoError(t, err)
|
writer := httptest.NewRecorder()
|
||||||
// request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader(sszvalue))
|
writer.Body = &bytes.Buffer{}
|
||||||
// request.Header.Set("Accept", "application/octet-stream")
|
server.PublishBlindedBlock(writer, request)
|
||||||
// writer := httptest.NewRecorder()
|
assert.Equal(t, http.StatusOK, writer.Code)
|
||||||
// writer.Body = &bytes.Buffer{}
|
})
|
||||||
// server.PublishBlindedBlock(writer, request)
|
|
||||||
// assert.Equal(t, http.StatusOK, writer.Code)
|
|
||||||
//})
|
|
||||||
t.Run("invalid block", func(t *testing.T) {
|
t.Run("invalid block", func(t *testing.T) {
|
||||||
server := &Server{
|
server := &Server{
|
||||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||||
@@ -1597,12 +1590,12 @@ func TestPublishBlockV2(t *testing.T) {
|
|||||||
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
||||||
v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
||||||
block, ok := req.Block.(*eth.GenericSignedBeaconBlock_Deneb)
|
block, ok := req.Block.(*eth.GenericSignedBeaconBlock_Deneb)
|
||||||
converted, err := shared.BeaconBlockDenebFromConsensus(block.Deneb.Block)
|
converted, err := shared.SignedBeaconBlockContentsDenebFromConsensus(block.Deneb)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
var signedblock *shared.SignedBeaconBlockContentsDeneb
|
var signedblock *shared.SignedBeaconBlockContentsDeneb
|
||||||
err = json.Unmarshal([]byte(rpctesting.DenebBlockContents), &signedblock)
|
err = json.Unmarshal([]byte(rpctesting.DenebBlockContents), &signedblock)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.DeepEqual(t, converted, signedblock.SignedBlock.Message)
|
require.DeepEqual(t, converted, signedblock)
|
||||||
return ok
|
return ok
|
||||||
}))
|
}))
|
||||||
server := &Server{
|
server := &Server{
|
||||||
@@ -1714,33 +1707,29 @@ func TestPublishBlockV2SSZ(t *testing.T) {
|
|||||||
assert.Equal(t, http.StatusOK, writer.Code)
|
assert.Equal(t, http.StatusOK, writer.Code)
|
||||||
})
|
})
|
||||||
t.Run("Deneb", func(t *testing.T) {
|
t.Run("Deneb", func(t *testing.T) {
|
||||||
// TODO: Fix this as part of beacon API changes
|
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
||||||
|
v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
||||||
|
_, ok := req.Block.(*eth.GenericSignedBeaconBlock_Deneb)
|
||||||
|
return ok
|
||||||
|
}))
|
||||||
|
server := &Server{
|
||||||
|
V1Alpha1ValidatorServer: v1alpha1Server,
|
||||||
|
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||||
|
}
|
||||||
|
|
||||||
//v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
var dblock shared.SignedBeaconBlockContentsDeneb
|
||||||
//v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
err := json.Unmarshal([]byte(rpctesting.DenebBlockContents), &dblock)
|
||||||
// _, ok := req.Block.(*eth.GenericSignedBeaconBlock_Deneb)
|
require.NoError(t, err)
|
||||||
// return ok
|
genericBlock, err := dblock.ToGeneric()
|
||||||
//}))
|
require.NoError(t, err)
|
||||||
//server := &Server{
|
sszvalue, err := genericBlock.GetDeneb().MarshalSSZ()
|
||||||
// V1Alpha1ValidatorServer: v1alpha1Server,
|
require.NoError(t, err)
|
||||||
// SyncChecker: &mockSync.Sync{IsSyncing: false},
|
request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader(sszvalue))
|
||||||
//}
|
request.Header.Set("Accept", api.OctetStreamMediaType)
|
||||||
//
|
writer := httptest.NewRecorder()
|
||||||
//var dblock shared.SignedBeaconBlockContentsDeneb
|
writer.Body = &bytes.Buffer{}
|
||||||
//err := json.Unmarshal([]byte(rpctesting.DenebBlockContents), &dblock)
|
server.PublishBlockV2(writer, request)
|
||||||
//require.NoError(t, err)
|
assert.Equal(t, http.StatusOK, writer.Code)
|
||||||
//genericBlock, err := dblock.ToGeneric()
|
|
||||||
//require.NoError(t, err)
|
|
||||||
//v2block, err := migration.V1Alpha1SignedBeaconBlockDenebAndBlobsToV2(genericBlock.GetDeneb())
|
|
||||||
//require.NoError(t, err)
|
|
||||||
//sszvalue, err := v2block.MarshalSSZ()
|
|
||||||
//require.NoError(t, err)
|
|
||||||
//request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader(sszvalue))
|
|
||||||
//request.Header.Set("Accept", "application/octet-stream")
|
|
||||||
//writer := httptest.NewRecorder()
|
|
||||||
//writer.Body = &bytes.Buffer{}
|
|
||||||
//server.PublishBlockV2(writer, request)
|
|
||||||
//assert.Equal(t, http.StatusOK, writer.Code)
|
|
||||||
})
|
})
|
||||||
t.Run("invalid block", func(t *testing.T) {
|
t.Run("invalid block", func(t *testing.T) {
|
||||||
server := &Server{
|
server := &Server{
|
||||||
@@ -1854,12 +1843,12 @@ func TestPublishBlindedBlockV2(t *testing.T) {
|
|||||||
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
||||||
v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
||||||
block, ok := req.Block.(*eth.GenericSignedBeaconBlock_BlindedDeneb)
|
block, ok := req.Block.(*eth.GenericSignedBeaconBlock_BlindedDeneb)
|
||||||
converted, err := shared.BlindedBeaconBlockDenebFromConsensus(block.BlindedDeneb.SignedBlindedBlock.Message)
|
converted, err := shared.BlindedBeaconBlockDenebFromConsensus(block.BlindedDeneb.Message)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
var signedblock *shared.SignedBlindedBeaconBlockContentsDeneb
|
var signedblock *shared.SignedBlindedBeaconBlockDeneb
|
||||||
err = json.Unmarshal([]byte(rpctesting.BlindedDenebBlockContents), &signedblock)
|
err = json.Unmarshal([]byte(rpctesting.BlindedDenebBlock), &signedblock)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.DeepEqual(t, converted, signedblock.SignedBlindedBlock.Message)
|
require.DeepEqual(t, converted, signedblock.Message)
|
||||||
return ok
|
return ok
|
||||||
}))
|
}))
|
||||||
server := &Server{
|
server := &Server{
|
||||||
@@ -1867,7 +1856,7 @@ func TestPublishBlindedBlockV2(t *testing.T) {
|
|||||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||||
}
|
}
|
||||||
|
|
||||||
request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.BlindedDenebBlockContents)))
|
request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader([]byte(rpctesting.BlindedDenebBlock)))
|
||||||
writer := httptest.NewRecorder()
|
writer := httptest.NewRecorder()
|
||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
server.PublishBlindedBlockV2(writer, request)
|
server.PublishBlindedBlockV2(writer, request)
|
||||||
@@ -1971,34 +1960,31 @@ func TestPublishBlindedBlockV2SSZ(t *testing.T) {
|
|||||||
server.PublishBlindedBlockV2(writer, request)
|
server.PublishBlindedBlockV2(writer, request)
|
||||||
assert.Equal(t, http.StatusOK, writer.Code)
|
assert.Equal(t, http.StatusOK, writer.Code)
|
||||||
})
|
})
|
||||||
// TODO: update this test when updating beacon apis
|
t.Run("Deneb", func(t *testing.T) {
|
||||||
//t.Run("Deneb", func(t *testing.T) {
|
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
||||||
// v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
||||||
// v1alpha1Server.EXPECT().ProposeBeaconBlock(gomock.Any(), mock.MatchedBy(func(req *eth.GenericSignedBeaconBlock) bool {
|
_, ok := req.Block.(*eth.GenericSignedBeaconBlock_BlindedDeneb)
|
||||||
// _, ok := req.Block.(*eth.GenericSignedBeaconBlock_BlindedDeneb)
|
return ok
|
||||||
// return ok
|
}))
|
||||||
// }))
|
server := &Server{
|
||||||
// server := &Server{
|
V1Alpha1ValidatorServer: v1alpha1Server,
|
||||||
// V1Alpha1ValidatorServer: v1alpha1Server,
|
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||||
// SyncChecker: &mockSync.Sync{IsSyncing: false},
|
}
|
||||||
// }
|
|
||||||
//
|
var cblock shared.SignedBlindedBeaconBlockDeneb
|
||||||
// var cblock shared.SignedBlindedBeaconBlockContentsDeneb
|
err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlock), &cblock)
|
||||||
// err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlockContents), &cblock)
|
require.NoError(t, err)
|
||||||
// require.NoError(t, err)
|
genericBlock, err := cblock.ToGeneric()
|
||||||
// genericBlock, err := cblock.ToGeneric()
|
require.NoError(t, err)
|
||||||
// require.NoError(t, err)
|
sszvalue, err := genericBlock.GetBlindedDeneb().MarshalSSZ()
|
||||||
// v1block, err := migration.V1Alpha1SignedBlindedBlockAndBlobsDenebToV2Blinded(genericBlock.GetBlindedDeneb())
|
require.NoError(t, err)
|
||||||
// require.NoError(t, err)
|
request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader(sszvalue))
|
||||||
// sszvalue, err := v1block.MarshalSSZ()
|
request.Header.Set("Accept", api.OctetStreamMediaType)
|
||||||
// require.NoError(t, err)
|
writer := httptest.NewRecorder()
|
||||||
// request := httptest.NewRequest(http.MethodPost, "http://foo.example", bytes.NewReader(sszvalue))
|
writer.Body = &bytes.Buffer{}
|
||||||
// request.Header.Set("Accept", "application/octet-stream")
|
server.PublishBlindedBlockV2(writer, request)
|
||||||
// writer := httptest.NewRecorder()
|
assert.Equal(t, http.StatusOK, writer.Code)
|
||||||
// writer.Body = &bytes.Buffer{}
|
})
|
||||||
// server.PublishBlindedBlockV2(writer, request)
|
|
||||||
// assert.Equal(t, http.StatusOK, writer.Code)
|
|
||||||
//})
|
|
||||||
t.Run("invalid block", func(t *testing.T) {
|
t.Run("invalid block", func(t *testing.T) {
|
||||||
server := &Server{
|
server := &Server{
|
||||||
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
SyncChecker: &mockSync.Sync{IsSyncing: false},
|
||||||
|
|||||||
@@ -10,20 +10,13 @@ go_library(
|
|||||||
importpath = "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/blob",
|
importpath = "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/blob",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"//beacon-chain/blockchain:go_default_library",
|
"//beacon-chain/rpc/core:go_default_library",
|
||||||
"//beacon-chain/db:go_default_library",
|
"//beacon-chain/rpc/eth/shared:go_default_library",
|
||||||
"//beacon-chain/rpc/lookup:go_default_library",
|
"//beacon-chain/rpc/lookup:go_default_library",
|
||||||
"//config/fieldparams:go_default_library",
|
"//config/fieldparams:go_default_library",
|
||||||
"//config/params:go_default_library",
|
|
||||||
"//consensus-types/primitives:go_default_library",
|
|
||||||
"//encoding/bytesutil:go_default_library",
|
|
||||||
"//network/http:go_default_library",
|
"//network/http:go_default_library",
|
||||||
"//proto/eth/v2:go_default_library",
|
|
||||||
"//proto/migration:go_default_library",
|
|
||||||
"//proto/prysm/v1alpha1:go_default_library",
|
"//proto/prysm/v1alpha1:go_default_library",
|
||||||
"//time/slots:go_default_library",
|
|
||||||
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
|
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
|
||||||
"@com_github_pkg_errors//:go_default_library",
|
|
||||||
"@io_opencensus_go//trace:go_default_library",
|
"@io_opencensus_go//trace:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@@ -34,14 +27,16 @@ go_test(
|
|||||||
embed = [":go_default_library"],
|
embed = [":go_default_library"],
|
||||||
deps = [
|
deps = [
|
||||||
"//beacon-chain/blockchain/testing:go_default_library",
|
"//beacon-chain/blockchain/testing:go_default_library",
|
||||||
|
"//beacon-chain/db/filesystem:go_default_library",
|
||||||
"//beacon-chain/db/testing:go_default_library",
|
"//beacon-chain/db/testing:go_default_library",
|
||||||
"//config/fieldparams:go_default_library",
|
"//beacon-chain/rpc/lookup:go_default_library",
|
||||||
|
"//beacon-chain/verification:go_default_library",
|
||||||
"//config/params:go_default_library",
|
"//config/params:go_default_library",
|
||||||
"//encoding/bytesutil:go_default_library",
|
|
||||||
"//network/http:go_default_library",
|
"//network/http:go_default_library",
|
||||||
"//proto/prysm/v1alpha1:go_default_library",
|
"//proto/prysm/v1alpha1:go_default_library",
|
||||||
"//testing/assert:go_default_library",
|
"//testing/assert:go_default_library",
|
||||||
"//testing/require: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_ethereum_go_ethereum//common/hexutil:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -7,116 +7,60 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
"github.com/pkg/errors"
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/core"
|
||||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/lookup"
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared"
|
||||||
field_params "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
|
field_params "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
|
||||||
"github.com/prysmaticlabs/prysm/v4/config/params"
|
httputil "github.com/prysmaticlabs/prysm/v4/network/http"
|
||||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
|
||||||
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
|
|
||||||
http2 "github.com/prysmaticlabs/prysm/v4/network/http"
|
|
||||||
ethpb "github.com/prysmaticlabs/prysm/v4/proto/eth/v2"
|
|
||||||
"github.com/prysmaticlabs/prysm/v4/proto/migration"
|
|
||||||
eth "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
eth "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
||||||
"github.com/prysmaticlabs/prysm/v4/time/slots"
|
|
||||||
"go.opencensus.io/trace"
|
"go.opencensus.io/trace"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Blobs is an HTTP handler for Beacon API getBlobs.
|
// Blobs is an HTTP handler for Beacon API getBlobs.
|
||||||
func (s *Server) Blobs(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) Blobs(w http.ResponseWriter, r *http.Request) {
|
||||||
_, span := trace.StartSpan(r.Context(), "beacon.Blobs")
|
ctx, span := trace.StartSpan(r.Context(), "beacon.Blobs")
|
||||||
defer span.End()
|
defer span.End()
|
||||||
|
var sidecars []*eth.BlobSidecar
|
||||||
var sidecars []*eth.DeprecatedBlobSidecar
|
|
||||||
var root []byte
|
|
||||||
|
|
||||||
indices := parseIndices(r.URL)
|
indices := parseIndices(r.URL)
|
||||||
segments := strings.Split(r.URL.Path, "/")
|
segments := strings.Split(r.URL.Path, "/")
|
||||||
blockId := segments[len(segments)-1]
|
blockId := segments[len(segments)-1]
|
||||||
switch blockId {
|
|
||||||
case "genesis":
|
verifiedBlobs, rpcErr := s.Blocker.Blobs(ctx, blockId, indices)
|
||||||
http2.HandleError(w, "blobs are not supported for Phase 0 fork", http.StatusBadRequest)
|
if rpcErr != nil {
|
||||||
return
|
code := core.ErrorReasonToHTTP(rpcErr.Reason)
|
||||||
case "head":
|
switch code {
|
||||||
var err error
|
case http.StatusBadRequest:
|
||||||
root, err = s.ChainInfoFetcher.HeadRoot(r.Context())
|
httputil.HandleError(w, "Invalid block ID: "+rpcErr.Err.Error(), code)
|
||||||
if err != nil {
|
|
||||||
http2.HandleError(w, errors.Wrapf(err, "could not retrieve head root").Error(), http.StatusInternalServerError)
|
|
||||||
return
|
return
|
||||||
}
|
case http.StatusNotFound:
|
||||||
case "finalized":
|
httputil.HandleError(w, "Block not found: "+rpcErr.Err.Error(), code)
|
||||||
fcp := s.ChainInfoFetcher.FinalizedCheckpt()
|
|
||||||
if fcp == nil {
|
|
||||||
http2.HandleError(w, "received nil finalized checkpoint", http.StatusInternalServerError)
|
|
||||||
return
|
return
|
||||||
}
|
case http.StatusInternalServerError:
|
||||||
root = fcp.Root
|
httputil.HandleError(w, "Internal server error: "+rpcErr.Err.Error(), code)
|
||||||
case "justified":
|
|
||||||
jcp := s.ChainInfoFetcher.CurrentJustifiedCheckpt()
|
|
||||||
if jcp == nil {
|
|
||||||
http2.HandleError(w, "received nil justified checkpoint", http.StatusInternalServerError)
|
|
||||||
return
|
return
|
||||||
}
|
default:
|
||||||
root = jcp.Root
|
httputil.HandleError(w, rpcErr.Err.Error(), code)
|
||||||
default:
|
|
||||||
if bytesutil.IsHex([]byte(blockId)) {
|
|
||||||
var err error
|
|
||||||
root, err = hexutil.Decode(blockId)
|
|
||||||
if err != nil {
|
|
||||||
http2.HandleError(w, errors.Wrap(err, "could not decode block ID into hex").Error(), http.StatusInternalServerError)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
slot, err := strconv.ParseUint(blockId, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
http2.HandleError(w, lookup.NewBlockIdParseError(err).Error(), http.StatusBadRequest)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
denebStart, err := slots.EpochStart(params.BeaconConfig().DenebForkEpoch)
|
|
||||||
if err != nil {
|
|
||||||
http2.HandleError(w, errors.Wrap(err, "could not calculate Deneb start slot").Error(), http.StatusInternalServerError)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if primitives.Slot(slot) < denebStart {
|
|
||||||
http2.HandleError(w, "blobs are not supported before Deneb fork", http.StatusBadRequest)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
sidecars, err = s.BeaconDB.BlobSidecarsBySlot(r.Context(), primitives.Slot(slot), indices...)
|
|
||||||
if err != nil {
|
|
||||||
http2.HandleError(w, errors.Wrapf(err, "could not retrieve blobs for slot %d", slot).Error(), http.StatusInternalServerError)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
http2.WriteJson(w, buildSidecarsResponse(sidecars))
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for i := range verifiedBlobs {
|
||||||
var err error
|
sidecars = append(sidecars, verifiedBlobs[i].BlobSidecar)
|
||||||
sidecars, err = s.BeaconDB.BlobSidecarsByRoot(r.Context(), bytesutil.ToBytes32(root), indices...)
|
|
||||||
if err != nil {
|
|
||||||
http2.HandleError(w, errors.Wrapf(err, "could not retrieve blobs for root %#x", root).Error(), http.StatusInternalServerError)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
ssz := httputil.SszRequested(r)
|
||||||
ssz := http2.SszRequested(r)
|
|
||||||
if ssz {
|
if ssz {
|
||||||
v2sidecars, err := migration.V1Alpha1BlobSidecarsToV2(sidecars)
|
sidecarResp := ð.BlobSidecars{
|
||||||
if err != nil {
|
Sidecars: sidecars,
|
||||||
http2.HandleError(w, err.Error(), http.StatusInternalServerError)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
sidecarResp := ðpb.BlobSidecars{
|
|
||||||
Sidecars: v2sidecars,
|
|
||||||
}
|
}
|
||||||
sszResp, err := sidecarResp.MarshalSSZ()
|
sszResp, err := sidecarResp.MarshalSSZ()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http2.HandleError(w, err.Error(), http.StatusInternalServerError)
|
httputil.HandleError(w, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
http2.WriteSsz(w, sszResp, "blob_sidecars.ssz")
|
httputil.WriteSsz(w, sszResp, "blob_sidecars.ssz")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
http2.WriteJson(w, buildSidecarsResponse(sidecars))
|
httputil.WriteJson(w, buildSidecarsResponse(sidecars))
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseIndices filters out invalid and duplicate blob indices
|
// parseIndices filters out invalid and duplicate blob indices
|
||||||
@@ -142,18 +86,20 @@ loop:
|
|||||||
return indices
|
return indices
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildSidecarsResponse(sidecars []*eth.DeprecatedBlobSidecar) *SidecarsResponse {
|
func buildSidecarsResponse(sidecars []*eth.BlobSidecar) *SidecarsResponse {
|
||||||
resp := &SidecarsResponse{Data: make([]*Sidecar, len(sidecars))}
|
resp := &SidecarsResponse{Data: make([]*Sidecar, len(sidecars))}
|
||||||
for i, sc := range sidecars {
|
for i, sc := range sidecars {
|
||||||
|
proofs := make([]string, len(sc.CommitmentInclusionProof))
|
||||||
|
for j := range sc.CommitmentInclusionProof {
|
||||||
|
proofs[j] = hexutil.Encode(sc.CommitmentInclusionProof[j])
|
||||||
|
}
|
||||||
resp.Data[i] = &Sidecar{
|
resp.Data[i] = &Sidecar{
|
||||||
BlockRoot: hexutil.Encode(sc.BlockRoot),
|
Index: strconv.FormatUint(sc.Index, 10),
|
||||||
Index: strconv.FormatUint(sc.Index, 10),
|
Blob: hexutil.Encode(sc.Blob),
|
||||||
Slot: strconv.FormatUint(uint64(sc.Slot), 10),
|
KzgCommitment: hexutil.Encode(sc.KzgCommitment),
|
||||||
BlockParentRoot: hexutil.Encode(sc.BlockParentRoot),
|
SignedBeaconBlockHeader: shared.SignedBeaconBlockHeaderFromConsensus(sc.SignedBlockHeader),
|
||||||
ProposerIndex: strconv.FormatUint(uint64(sc.ProposerIndex), 10),
|
KzgProof: hexutil.Encode(sc.KzgProof),
|
||||||
Blob: hexutil.Encode(sc.Blob),
|
CommitmentInclusionProof: proofs,
|
||||||
KZGCommitment: hexutil.Encode(sc.KzgCommitment),
|
|
||||||
KZGProof: hexutil.Encode(sc.KzgProof),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
@@ -12,14 +12,16 @@ import (
|
|||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
mockChain "github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain/testing"
|
mockChain "github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain/testing"
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/db/filesystem"
|
||||||
testDB "github.com/prysmaticlabs/prysm/v4/beacon-chain/db/testing"
|
testDB "github.com/prysmaticlabs/prysm/v4/beacon-chain/db/testing"
|
||||||
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/lookup"
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/verification"
|
||||||
"github.com/prysmaticlabs/prysm/v4/config/params"
|
"github.com/prysmaticlabs/prysm/v4/config/params"
|
||||||
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
|
|
||||||
http2 "github.com/prysmaticlabs/prysm/v4/network/http"
|
http2 "github.com/prysmaticlabs/prysm/v4/network/http"
|
||||||
eth "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
eth "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
||||||
"github.com/prysmaticlabs/prysm/v4/testing/assert"
|
"github.com/prysmaticlabs/prysm/v4/testing/assert"
|
||||||
"github.com/prysmaticlabs/prysm/v4/testing/require"
|
"github.com/prysmaticlabs/prysm/v4/testing/require"
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/testing/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParseIndices(t *testing.T) {
|
func TestParseIndices(t *testing.T) {
|
||||||
@@ -33,56 +35,26 @@ func TestBlobs(t *testing.T) {
|
|||||||
params.OverrideBeaconConfig(cfg)
|
params.OverrideBeaconConfig(cfg)
|
||||||
|
|
||||||
db := testDB.SetupDB(t)
|
db := testDB.SetupDB(t)
|
||||||
blockroot := bytesutil.PadTo([]byte("blockroot"), 32)
|
denebBlock, blobs := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 123, 4)
|
||||||
require.NoError(t, db.SaveBlobSidecar(context.Background(), []*eth.DeprecatedBlobSidecar{
|
require.NoError(t, db.SaveBlock(context.Background(), denebBlock))
|
||||||
{
|
_, bs, err := filesystem.NewEphemeralBlobStorageWithFs(t)
|
||||||
BlockRoot: blockroot,
|
require.NoError(t, err)
|
||||||
Index: 0,
|
testSidecars, err := verification.BlobSidecarSliceNoop(blobs)
|
||||||
Slot: 123,
|
require.NoError(t, err)
|
||||||
BlockParentRoot: []byte("blockparentroot"),
|
for i := range testSidecars {
|
||||||
ProposerIndex: 123,
|
require.NoError(t, bs.Save(testSidecars[i]))
|
||||||
Blob: []byte("blob0"),
|
}
|
||||||
KzgCommitment: []byte("kzgcommitment0"),
|
blockRoot := blobs[0].BlockRoot()
|
||||||
KzgProof: []byte("kzgproof0"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
BlockRoot: blockroot,
|
|
||||||
Index: 1,
|
|
||||||
Slot: 123,
|
|
||||||
BlockParentRoot: []byte("blockparentroot"),
|
|
||||||
ProposerIndex: 123,
|
|
||||||
Blob: []byte("blob1"),
|
|
||||||
KzgCommitment: []byte("kzgcommitment1"),
|
|
||||||
KzgProof: []byte("kzgproof1"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
BlockRoot: blockroot,
|
|
||||||
Index: 2,
|
|
||||||
Slot: 123,
|
|
||||||
BlockParentRoot: []byte("blockparentroot"),
|
|
||||||
ProposerIndex: 123,
|
|
||||||
Blob: []byte("blob2"),
|
|
||||||
KzgCommitment: []byte("kzgcommitment2"),
|
|
||||||
KzgProof: []byte("kzgproof2"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
BlockRoot: blockroot,
|
|
||||||
Index: 3,
|
|
||||||
Slot: 123,
|
|
||||||
BlockParentRoot: []byte("blockparentroot"),
|
|
||||||
ProposerIndex: 123,
|
|
||||||
Blob: []byte("blob3"),
|
|
||||||
KzgCommitment: []byte("kzgcommitment3"),
|
|
||||||
KzgProof: []byte("kzgproof3"),
|
|
||||||
},
|
|
||||||
}))
|
|
||||||
|
|
||||||
t.Run("genesis", func(t *testing.T) {
|
t.Run("genesis", func(t *testing.T) {
|
||||||
u := "http://foo.example/genesis"
|
u := "http://foo.example/genesis"
|
||||||
request := httptest.NewRequest("GET", u, nil)
|
request := httptest.NewRequest("GET", u, nil)
|
||||||
writer := httptest.NewRecorder()
|
writer := httptest.NewRecorder()
|
||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
s := &Server{}
|
blocker := &lookup.BeaconDbBlocker{}
|
||||||
|
s := &Server{
|
||||||
|
Blocker: blocker,
|
||||||
|
}
|
||||||
|
|
||||||
s.Blobs(writer, request)
|
s.Blobs(writer, request)
|
||||||
|
|
||||||
@@ -90,16 +62,20 @@ func TestBlobs(t *testing.T) {
|
|||||||
e := &http2.DefaultErrorJson{}
|
e := &http2.DefaultErrorJson{}
|
||||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e))
|
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e))
|
||||||
assert.Equal(t, http.StatusBadRequest, e.Code)
|
assert.Equal(t, http.StatusBadRequest, e.Code)
|
||||||
assert.Equal(t, "blobs are not supported for Phase 0 fork", e.Message)
|
assert.StringContains(t, "blobs are not supported for Phase 0 fork", e.Message)
|
||||||
})
|
})
|
||||||
t.Run("head", func(t *testing.T) {
|
t.Run("head", func(t *testing.T) {
|
||||||
u := "http://foo.example/head"
|
u := "http://foo.example/head"
|
||||||
request := httptest.NewRequest("GET", u, nil)
|
request := httptest.NewRequest("GET", u, nil)
|
||||||
writer := httptest.NewRecorder()
|
writer := httptest.NewRecorder()
|
||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
s := &Server{
|
blocker := &lookup.BeaconDbBlocker{
|
||||||
ChainInfoFetcher: &mockChain.ChainService{Root: blockroot},
|
ChainInfoFetcher: &mockChain.ChainService{Root: blockRoot[:]},
|
||||||
BeaconDB: db,
|
BeaconDB: db,
|
||||||
|
BlobStorage: bs,
|
||||||
|
}
|
||||||
|
s := &Server{
|
||||||
|
Blocker: blocker,
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Blobs(writer, request)
|
s.Blobs(writer, request)
|
||||||
@@ -110,53 +86,41 @@ func TestBlobs(t *testing.T) {
|
|||||||
require.Equal(t, 4, len(resp.Data))
|
require.Equal(t, 4, len(resp.Data))
|
||||||
sidecar := resp.Data[0]
|
sidecar := resp.Data[0]
|
||||||
require.NotNil(t, sidecar)
|
require.NotNil(t, sidecar)
|
||||||
assert.Equal(t, "0x626c6f636b726f6f740000000000000000000000000000000000000000000000", sidecar.BlockRoot)
|
|
||||||
assert.Equal(t, "0", sidecar.Index)
|
assert.Equal(t, "0", sidecar.Index)
|
||||||
assert.Equal(t, "123", sidecar.Slot)
|
assert.Equal(t, hexutil.Encode(blobs[0].Blob), sidecar.Blob)
|
||||||
assert.Equal(t, "0x626c6f636b706172656e74726f6f74", sidecar.BlockParentRoot)
|
assert.Equal(t, hexutil.Encode(blobs[0].KzgCommitment), sidecar.KzgCommitment)
|
||||||
assert.Equal(t, "123", sidecar.ProposerIndex)
|
assert.Equal(t, hexutil.Encode(blobs[0].KzgProof), sidecar.KzgProof)
|
||||||
assert.Equal(t, "0x626c6f6230", sidecar.Blob)
|
|
||||||
assert.Equal(t, "0x6b7a67636f6d6d69746d656e7430", sidecar.KZGCommitment)
|
|
||||||
assert.Equal(t, "0x6b7a6770726f6f6630", sidecar.KZGProof)
|
|
||||||
sidecar = resp.Data[1]
|
sidecar = resp.Data[1]
|
||||||
require.NotNil(t, sidecar)
|
require.NotNil(t, sidecar)
|
||||||
assert.Equal(t, "0x626c6f636b726f6f740000000000000000000000000000000000000000000000", sidecar.BlockRoot)
|
|
||||||
assert.Equal(t, "1", sidecar.Index)
|
assert.Equal(t, "1", sidecar.Index)
|
||||||
assert.Equal(t, "123", sidecar.Slot)
|
assert.Equal(t, hexutil.Encode(blobs[1].Blob), sidecar.Blob)
|
||||||
assert.Equal(t, "0x626c6f636b706172656e74726f6f74", sidecar.BlockParentRoot)
|
assert.Equal(t, hexutil.Encode(blobs[1].KzgCommitment), sidecar.KzgCommitment)
|
||||||
assert.Equal(t, "123", sidecar.ProposerIndex)
|
assert.Equal(t, hexutil.Encode(blobs[1].KzgProof), sidecar.KzgProof)
|
||||||
assert.Equal(t, "0x626c6f6231", sidecar.Blob)
|
|
||||||
assert.Equal(t, "0x6b7a67636f6d6d69746d656e7431", sidecar.KZGCommitment)
|
|
||||||
assert.Equal(t, "0x6b7a6770726f6f6631", sidecar.KZGProof)
|
|
||||||
sidecar = resp.Data[2]
|
sidecar = resp.Data[2]
|
||||||
require.NotNil(t, sidecar)
|
require.NotNil(t, sidecar)
|
||||||
assert.Equal(t, "0x626c6f636b726f6f740000000000000000000000000000000000000000000000", sidecar.BlockRoot)
|
|
||||||
assert.Equal(t, "2", sidecar.Index)
|
assert.Equal(t, "2", sidecar.Index)
|
||||||
assert.Equal(t, "123", sidecar.Slot)
|
assert.Equal(t, hexutil.Encode(blobs[2].Blob), sidecar.Blob)
|
||||||
assert.Equal(t, "0x626c6f636b706172656e74726f6f74", sidecar.BlockParentRoot)
|
assert.Equal(t, hexutil.Encode(blobs[2].KzgCommitment), sidecar.KzgCommitment)
|
||||||
assert.Equal(t, "123", sidecar.ProposerIndex)
|
assert.Equal(t, hexutil.Encode(blobs[2].KzgProof), sidecar.KzgProof)
|
||||||
assert.Equal(t, "0x626c6f6232", sidecar.Blob)
|
|
||||||
assert.Equal(t, "0x6b7a67636f6d6d69746d656e7432", sidecar.KZGCommitment)
|
|
||||||
assert.Equal(t, "0x6b7a6770726f6f6632", sidecar.KZGProof)
|
|
||||||
sidecar = resp.Data[3]
|
sidecar = resp.Data[3]
|
||||||
require.NotNil(t, sidecar)
|
require.NotNil(t, sidecar)
|
||||||
assert.Equal(t, "0x626c6f636b726f6f740000000000000000000000000000000000000000000000", sidecar.BlockRoot)
|
|
||||||
assert.Equal(t, "3", sidecar.Index)
|
assert.Equal(t, "3", sidecar.Index)
|
||||||
assert.Equal(t, "123", sidecar.Slot)
|
assert.Equal(t, hexutil.Encode(blobs[3].Blob), sidecar.Blob)
|
||||||
assert.Equal(t, "0x626c6f636b706172656e74726f6f74", sidecar.BlockParentRoot)
|
assert.Equal(t, hexutil.Encode(blobs[3].KzgCommitment), sidecar.KzgCommitment)
|
||||||
assert.Equal(t, "123", sidecar.ProposerIndex)
|
assert.Equal(t, hexutil.Encode(blobs[3].KzgProof), sidecar.KzgProof)
|
||||||
assert.Equal(t, "0x626c6f6233", sidecar.Blob)
|
|
||||||
assert.Equal(t, "0x6b7a67636f6d6d69746d656e7433", sidecar.KZGCommitment)
|
|
||||||
assert.Equal(t, "0x6b7a6770726f6f6633", sidecar.KZGProof)
|
|
||||||
})
|
})
|
||||||
t.Run("finalized", func(t *testing.T) {
|
t.Run("finalized", func(t *testing.T) {
|
||||||
u := "http://foo.example/finalized"
|
u := "http://foo.example/finalized"
|
||||||
request := httptest.NewRequest("GET", u, nil)
|
request := httptest.NewRequest("GET", u, nil)
|
||||||
writer := httptest.NewRecorder()
|
writer := httptest.NewRecorder()
|
||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
s := &Server{
|
blocker := &lookup.BeaconDbBlocker{
|
||||||
ChainInfoFetcher: &mockChain.ChainService{FinalizedCheckPoint: ð.Checkpoint{Root: blockroot}},
|
ChainInfoFetcher: &mockChain.ChainService{FinalizedCheckPoint: ð.Checkpoint{Root: blockRoot[:]}},
|
||||||
BeaconDB: db,
|
BeaconDB: db,
|
||||||
|
BlobStorage: bs,
|
||||||
|
}
|
||||||
|
s := &Server{
|
||||||
|
Blocker: blocker,
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Blobs(writer, request)
|
s.Blobs(writer, request)
|
||||||
@@ -171,9 +135,13 @@ func TestBlobs(t *testing.T) {
|
|||||||
request := httptest.NewRequest("GET", u, nil)
|
request := httptest.NewRequest("GET", u, nil)
|
||||||
writer := httptest.NewRecorder()
|
writer := httptest.NewRecorder()
|
||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
s := &Server{
|
blocker := &lookup.BeaconDbBlocker{
|
||||||
ChainInfoFetcher: &mockChain.ChainService{CurrentJustifiedCheckPoint: ð.Checkpoint{Root: blockroot}},
|
ChainInfoFetcher: &mockChain.ChainService{CurrentJustifiedCheckPoint: ð.Checkpoint{Root: blockRoot[:]}},
|
||||||
BeaconDB: db,
|
BeaconDB: db,
|
||||||
|
BlobStorage: bs,
|
||||||
|
}
|
||||||
|
s := &Server{
|
||||||
|
Blocker: blocker,
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Blobs(writer, request)
|
s.Blobs(writer, request)
|
||||||
@@ -184,12 +152,16 @@ func TestBlobs(t *testing.T) {
|
|||||||
require.Equal(t, 4, len(resp.Data))
|
require.Equal(t, 4, len(resp.Data))
|
||||||
})
|
})
|
||||||
t.Run("root", func(t *testing.T) {
|
t.Run("root", func(t *testing.T) {
|
||||||
u := "http://foo.example/" + hexutil.Encode(blockroot)
|
u := "http://foo.example/" + hexutil.Encode(blockRoot[:])
|
||||||
request := httptest.NewRequest("GET", u, nil)
|
request := httptest.NewRequest("GET", u, nil)
|
||||||
writer := httptest.NewRecorder()
|
writer := httptest.NewRecorder()
|
||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
|
blocker := &lookup.BeaconDbBlocker{
|
||||||
|
BeaconDB: db,
|
||||||
|
BlobStorage: bs,
|
||||||
|
}
|
||||||
s := &Server{
|
s := &Server{
|
||||||
BeaconDB: db,
|
Blocker: blocker,
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Blobs(writer, request)
|
s.Blobs(writer, request)
|
||||||
@@ -204,8 +176,12 @@ func TestBlobs(t *testing.T) {
|
|||||||
request := httptest.NewRequest("GET", u, nil)
|
request := httptest.NewRequest("GET", u, nil)
|
||||||
writer := httptest.NewRecorder()
|
writer := httptest.NewRecorder()
|
||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
|
blocker := &lookup.BeaconDbBlocker{
|
||||||
|
BeaconDB: db,
|
||||||
|
BlobStorage: bs,
|
||||||
|
}
|
||||||
s := &Server{
|
s := &Server{
|
||||||
BeaconDB: db,
|
Blocker: blocker,
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Blobs(writer, request)
|
s.Blobs(writer, request)
|
||||||
@@ -220,8 +196,13 @@ func TestBlobs(t *testing.T) {
|
|||||||
request := httptest.NewRequest("GET", u, nil)
|
request := httptest.NewRequest("GET", u, nil)
|
||||||
writer := httptest.NewRecorder()
|
writer := httptest.NewRecorder()
|
||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
|
blocker := &lookup.BeaconDbBlocker{
|
||||||
|
ChainInfoFetcher: &mockChain.ChainService{FinalizedCheckPoint: ð.Checkpoint{Root: blockRoot[:]}},
|
||||||
|
BeaconDB: db,
|
||||||
|
BlobStorage: bs,
|
||||||
|
}
|
||||||
s := &Server{
|
s := &Server{
|
||||||
BeaconDB: db,
|
Blocker: blocker,
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Blobs(writer, request)
|
s.Blobs(writer, request)
|
||||||
@@ -232,21 +213,20 @@ func TestBlobs(t *testing.T) {
|
|||||||
require.Equal(t, 1, len(resp.Data))
|
require.Equal(t, 1, len(resp.Data))
|
||||||
sidecar := resp.Data[0]
|
sidecar := resp.Data[0]
|
||||||
require.NotNil(t, sidecar)
|
require.NotNil(t, sidecar)
|
||||||
assert.Equal(t, "0x626c6f636b726f6f740000000000000000000000000000000000000000000000", sidecar.BlockRoot)
|
|
||||||
assert.Equal(t, "2", sidecar.Index)
|
assert.Equal(t, "2", sidecar.Index)
|
||||||
assert.Equal(t, "123", sidecar.Slot)
|
assert.Equal(t, hexutil.Encode(blobs[2].Blob), sidecar.Blob)
|
||||||
assert.Equal(t, "0x626c6f636b706172656e74726f6f74", sidecar.BlockParentRoot)
|
assert.Equal(t, hexutil.Encode(blobs[2].KzgCommitment), sidecar.KzgCommitment)
|
||||||
assert.Equal(t, "123", sidecar.ProposerIndex)
|
assert.Equal(t, hexutil.Encode(blobs[2].KzgProof), sidecar.KzgProof)
|
||||||
assert.Equal(t, "0x626c6f6232", sidecar.Blob)
|
|
||||||
assert.Equal(t, "0x6b7a67636f6d6d69746d656e7432", sidecar.KZGCommitment)
|
|
||||||
assert.Equal(t, "0x6b7a6770726f6f6632", sidecar.KZGProof)
|
|
||||||
})
|
})
|
||||||
t.Run("slot before Deneb fork", func(t *testing.T) {
|
t.Run("slot before Deneb fork", func(t *testing.T) {
|
||||||
u := "http://foo.example/31"
|
u := "http://foo.example/31"
|
||||||
request := httptest.NewRequest("GET", u, nil)
|
request := httptest.NewRequest("GET", u, nil)
|
||||||
writer := httptest.NewRecorder()
|
writer := httptest.NewRecorder()
|
||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
s := &Server{}
|
blocker := &lookup.BeaconDbBlocker{}
|
||||||
|
s := &Server{
|
||||||
|
Blocker: blocker,
|
||||||
|
}
|
||||||
|
|
||||||
s.Blobs(writer, request)
|
s.Blobs(writer, request)
|
||||||
|
|
||||||
@@ -254,14 +234,17 @@ func TestBlobs(t *testing.T) {
|
|||||||
e := &http2.DefaultErrorJson{}
|
e := &http2.DefaultErrorJson{}
|
||||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e))
|
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e))
|
||||||
assert.Equal(t, http.StatusBadRequest, e.Code)
|
assert.Equal(t, http.StatusBadRequest, e.Code)
|
||||||
assert.Equal(t, "blobs are not supported before Deneb fork", e.Message)
|
assert.StringContains(t, "blobs are not supported before Deneb fork", e.Message)
|
||||||
})
|
})
|
||||||
t.Run("malformed block ID", func(t *testing.T) {
|
t.Run("malformed block ID", func(t *testing.T) {
|
||||||
u := "http://foo.example/foo"
|
u := "http://foo.example/foo"
|
||||||
request := httptest.NewRequest("GET", u, nil)
|
request := httptest.NewRequest("GET", u, nil)
|
||||||
writer := httptest.NewRecorder()
|
writer := httptest.NewRecorder()
|
||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
s := &Server{}
|
blocker := &lookup.BeaconDbBlocker{}
|
||||||
|
s := &Server{
|
||||||
|
Blocker: blocker,
|
||||||
|
}
|
||||||
|
|
||||||
s.Blobs(writer, request)
|
s.Blobs(writer, request)
|
||||||
|
|
||||||
@@ -269,35 +252,24 @@ func TestBlobs(t *testing.T) {
|
|||||||
e := &http2.DefaultErrorJson{}
|
e := &http2.DefaultErrorJson{}
|
||||||
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e))
|
require.NoError(t, json.Unmarshal(writer.Body.Bytes(), e))
|
||||||
assert.Equal(t, http.StatusBadRequest, e.Code)
|
assert.Equal(t, http.StatusBadRequest, e.Code)
|
||||||
assert.Equal(t, true, strings.Contains(e.Message, "could not parse block ID"))
|
assert.Equal(t, true, strings.Contains(e.Message, "Invalid block ID"))
|
||||||
})
|
})
|
||||||
t.Run("ssz", func(t *testing.T) {
|
t.Run("ssz", func(t *testing.T) {
|
||||||
require.NoError(t, db.SaveBlobSidecar(context.Background(), []*eth.DeprecatedBlobSidecar{
|
|
||||||
{
|
|
||||||
BlockRoot: blockroot,
|
|
||||||
Index: 0,
|
|
||||||
Slot: 3,
|
|
||||||
BlockParentRoot: make([]byte, fieldparams.RootLength),
|
|
||||||
ProposerIndex: 123,
|
|
||||||
Blob: make([]byte, fieldparams.BlobLength),
|
|
||||||
KzgCommitment: make([]byte, fieldparams.BLSPubkeyLength),
|
|
||||||
KzgProof: make([]byte, fieldparams.BLSPubkeyLength),
|
|
||||||
},
|
|
||||||
}))
|
|
||||||
u := "http://foo.example/finalized?indices=0"
|
u := "http://foo.example/finalized?indices=0"
|
||||||
request := httptest.NewRequest("GET", u, nil)
|
request := httptest.NewRequest("GET", u, nil)
|
||||||
request.Header.Add("Accept", "application/octet-stream")
|
request.Header.Add("Accept", "application/octet-stream")
|
||||||
writer := httptest.NewRecorder()
|
writer := httptest.NewRecorder()
|
||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
s := &Server{
|
blocker := &lookup.BeaconDbBlocker{
|
||||||
ChainInfoFetcher: &mockChain.ChainService{FinalizedCheckPoint: ð.Checkpoint{Root: blockroot}},
|
ChainInfoFetcher: &mockChain.ChainService{FinalizedCheckPoint: ð.Checkpoint{Root: blockRoot[:]}},
|
||||||
BeaconDB: db,
|
BeaconDB: db,
|
||||||
|
BlobStorage: bs,
|
||||||
|
}
|
||||||
|
s := &Server{
|
||||||
|
Blocker: blocker,
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Blobs(writer, request)
|
s.Blobs(writer, request)
|
||||||
|
|
||||||
assert.Equal(t, http.StatusOK, writer.Code)
|
assert.Equal(t, http.StatusOK, writer.Code)
|
||||||
assert.Equal(t, len(writer.Body.Bytes()), 131260)
|
require.Equal(t, len(writer.Body.Bytes()), 131932)
|
||||||
assert.Equal(t, true, strings.HasPrefix(hexutil.Encode(writer.Body.Bytes()), "0x04000000626c6f636b726f6f7400000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000007b"))
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
package blob
|
package blob
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain"
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/lookup"
|
||||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/db"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Server struct {
|
type Server struct {
|
||||||
ChainInfoFetcher blockchain.ChainInfoFetcher
|
Blocker lookup.Blocker
|
||||||
BeaconDB db.ReadOnlyDatabase
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
package blob
|
package blob
|
||||||
|
|
||||||
|
import "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared"
|
||||||
|
|
||||||
type SidecarsResponse struct {
|
type SidecarsResponse struct {
|
||||||
Data []*Sidecar `json:"data"`
|
Data []*Sidecar `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Sidecar struct {
|
type Sidecar struct {
|
||||||
BlockRoot string `json:"block_root"`
|
Index string `json:"index"`
|
||||||
Index string `json:"index"`
|
Blob string `json:"blob"`
|
||||||
Slot string `json:"slot"`
|
SignedBeaconBlockHeader *shared.SignedBeaconBlockHeader `json:"signed_block_header"`
|
||||||
BlockParentRoot string `json:"block_parent_root"`
|
KzgCommitment string `json:"kzg_commitment"`
|
||||||
ProposerIndex string `json:"proposer_index"`
|
KzgProof string `json:"kzg_proof"`
|
||||||
Blob string `json:"blob"`
|
CommitmentInclusionProof []string `json:"commitment_inclusion_proof"`
|
||||||
KZGCommitment string `json:"kzg_commitment"`
|
|
||||||
KZGProof string `json:"kzg_proof"`
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"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"
|
||||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/core/feed/operation"
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/core/feed/operation"
|
||||||
statefeed "github.com/prysmaticlabs/prysm/v4/beacon-chain/core/feed/state"
|
statefeed "github.com/prysmaticlabs/prysm/v4/beacon-chain/core/feed/state"
|
||||||
@@ -179,18 +178,19 @@ func handleBlockOperationEvents(w http.ResponseWriter, flusher http.Flusher, req
|
|||||||
if _, ok := requestedTopics[BlobSidecarTopic]; !ok {
|
if _, ok := requestedTopics[BlobSidecarTopic]; !ok {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
blobData, ok := event.Data.(*operation.BlobSidecarReceivedData)
|
// TODO: fix this when we fix p2p
|
||||||
if !ok {
|
//blobData, ok := event.Data.(*operation.BlobSidecarReceivedData)
|
||||||
write(w, flusher, topicDataMismatch, event.Data, BlobSidecarTopic)
|
//if !ok {
|
||||||
return
|
// write(w, flusher, topicDataMismatch, event.Data, BlobSidecarTopic)
|
||||||
}
|
// return
|
||||||
versionedHash := blockchain.ConvertKzgCommitmentToVersionedHash(blobData.Blob.Message.KzgCommitment)
|
//}
|
||||||
|
//versionedHash := blockchain.ConvertKzgCommitmentToVersionedHash(blobData.Blob.Message.KzgCommitment)
|
||||||
blobEvent := &BlobSidecarEvent{
|
blobEvent := &BlobSidecarEvent{
|
||||||
BlockRoot: hexutil.Encode(blobData.Blob.Message.BlockRoot),
|
//BlockRoot: hexutil.Encode(blobData.Blob.Message.BlockRoot),
|
||||||
Index: fmt.Sprintf("%d", blobData.Blob.Message.Index),
|
//Index: fmt.Sprintf("%d", blobData.Blob.Message.Index),
|
||||||
Slot: fmt.Sprintf("%d", blobData.Blob.Message.Slot),
|
//Slot: fmt.Sprintf("%d", blobData.Blob.Message.Slot),
|
||||||
VersionedHash: versionedHash.String(),
|
//VersionedHash: versionedHash.String(),
|
||||||
KzgCommitment: hexutil.Encode(blobData.Blob.Message.KzgCommitment),
|
//KzgCommitment: hexutil.Encode(blobData.Blob.Message.KzgCommitment),
|
||||||
}
|
}
|
||||||
send(w, flusher, BlobSidecarTopic, blobEvent)
|
send(w, flusher, BlobSidecarTopic, blobEvent)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ func TestStreamEvents_OperationsEvents(t *testing.T) {
|
|||||||
OperationNotifier: &mockChain.MockOperationNotifier{},
|
OperationNotifier: &mockChain.MockOperationNotifier{},
|
||||||
}
|
}
|
||||||
|
|
||||||
topics := []string{AttestationTopic, VoluntaryExitTopic, SyncCommitteeContributionTopic, BLSToExecutionChangeTopic, BlobSidecarTopic}
|
topics := []string{AttestationTopic, VoluntaryExitTopic, SyncCommitteeContributionTopic, BLSToExecutionChangeTopic} // TODO: add blob sidecar back in later
|
||||||
for i, topic := range topics {
|
for i, topic := range topics {
|
||||||
topics[i] = "topics=" + topic
|
topics[i] = "topics=" + topic
|
||||||
}
|
}
|
||||||
@@ -115,12 +115,13 @@ func TestStreamEvents_OperationsEvents(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
s.OperationNotifier.OperationFeed().Send(&feed.Event{
|
// TODO: update when P2P is updated for blobs
|
||||||
Type: operation.BlobSidecarReceived,
|
//s.OperationNotifier.OperationFeed().Send(&feed.Event{
|
||||||
Data: &operation.BlobSidecarReceivedData{
|
// Type: operation.BlobSidecarReceived,
|
||||||
Blob: util.HydrateSignedBlobSidecar(ð.SignedBlobSidecar{}),
|
// Data: &operation.BlobSidecarReceivedData{
|
||||||
},
|
// Blob: util.HydrateSignedBlobSidecar(ð.SignedBlobSidecar{}),
|
||||||
})
|
// },
|
||||||
|
//})
|
||||||
// wait for feed
|
// wait for feed
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
request.Context().Done()
|
request.Context().Done()
|
||||||
@@ -320,11 +321,11 @@ data: {"message":{"aggregator_index":"0","contribution":{"slot":"0","beacon_bloc
|
|||||||
event: bls_to_execution_change
|
event: bls_to_execution_change
|
||||||
data: {"message":{"validator_index":"0","from_bls_pubkey":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","to_execution_address":"0x0000000000000000000000000000000000000000"},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}
|
data: {"message":{"validator_index":"0","from_bls_pubkey":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","to_execution_address":"0x0000000000000000000000000000000000000000"},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}
|
||||||
|
|
||||||
event: blob_sidecar
|
|
||||||
data: {"block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","index":"0","slot":"0","kzg_commitment":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","versioned_hash":"0x01b0761f87b081d5cf10757ccc89f12be355c70e2e29df288b65b30710dcbcd1"}
|
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
|
//event: blob_sidecar
|
||||||
|
//data: {"block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","index":"0","slot":"0","kzg_commitment":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","versioned_hash":"0x01b0761f87b081d5cf10757ccc89f12be355c70e2e29df288b65b30710dcbcd1"}
|
||||||
|
|
||||||
const stateResult = `event: head
|
const stateResult = `event: head
|
||||||
data: {"slot":"0","block":"0x0000000000000000000000000000000000000000000000000000000000000000","state":"0x0000000000000000000000000000000000000000000000000000000000000000","epoch_transition":true,"execution_optimistic":false,"previous_duty_dependent_root":"0x0000000000000000000000000000000000000000000000000000000000000000","current_duty_dependent_root":"0x0000000000000000000000000000000000000000000000000000000000000000"}
|
data: {"slot":"0","block":"0x0000000000000000000000000000000000000000000000000000000000000000","state":"0x0000000000000000000000000000000000000000000000000000000000000000","epoch_transition":true,"execution_optimistic":false,"previous_duty_dependent_root":"0x0000000000000000000000000000000000000000000000000000000000000000","current_duty_dependent_root":"0x0000000000000000000000000000000000000000000000000000000000000000"}
|
||||||
|
|
||||||
|
|||||||
@@ -168,13 +168,15 @@ type BlindedBeaconBlockBodyCapella struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SignedBeaconBlockContentsDeneb struct {
|
type SignedBeaconBlockContentsDeneb struct {
|
||||||
SignedBlock *SignedBeaconBlockDeneb `json:"signed_block" validate:"required"`
|
SignedBlock *SignedBeaconBlockDeneb `json:"signed_block" `
|
||||||
SignedBlobSidecars []*SignedBlobSidecar `json:"signed_blob_sidecars" validate:"dive"`
|
KzgProofs []string `json:"kzg_proofs"`
|
||||||
|
Blobs []string `json:"blobs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type BeaconBlockContentsDeneb struct {
|
type BeaconBlockContentsDeneb struct {
|
||||||
Block *BeaconBlockDeneb `json:"block" validate:"required"`
|
Block *BeaconBlockDeneb `json:"block" `
|
||||||
BlobSidecars []*BlobSidecar `json:"blob_sidecars" validate:"dive"`
|
KzgProofs []string `json:"kzg_proofs"`
|
||||||
|
Blobs []string `json:"blobs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SignedBeaconBlockDeneb struct {
|
type SignedBeaconBlockDeneb struct {
|
||||||
@@ -225,16 +227,6 @@ type ExecutionPayloadDeneb struct {
|
|||||||
Withdrawals []*Withdrawal `json:"withdrawals" validate:"required,dive"`
|
Withdrawals []*Withdrawal `json:"withdrawals" validate:"required,dive"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SignedBlindedBeaconBlockContentsDeneb struct {
|
|
||||||
SignedBlindedBlock *SignedBlindedBeaconBlockDeneb `json:"signed_blinded_block" validate:"required"`
|
|
||||||
SignedBlindedBlobSidecars []*SignedBlindedBlobSidecar `json:"signed_blinded_blob_sidecars" validate:"dive"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type BlindedBeaconBlockContentsDeneb struct {
|
|
||||||
BlindedBlock *BlindedBeaconBlockDeneb `json:"blinded_block" validate:"required"`
|
|
||||||
BlindedBlobSidecars []*BlindedBlobSidecar `json:"blinded_blob_sidecars" validate:"dive"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type BlindedBeaconBlockDeneb struct {
|
type BlindedBeaconBlockDeneb struct {
|
||||||
Slot string `json:"slot" validate:"required"`
|
Slot string `json:"slot" validate:"required"`
|
||||||
ProposerIndex string `json:"proposer_index" validate:"required"`
|
ProposerIndex string `json:"proposer_index" validate:"required"`
|
||||||
@@ -263,38 +255,6 @@ type BlindedBeaconBlockBodyDeneb struct {
|
|||||||
BlobKzgCommitments []string `json:"blob_kzg_commitments" validate:"required,dive,hexadecimal"`
|
BlobKzgCommitments []string `json:"blob_kzg_commitments" validate:"required,dive,hexadecimal"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SignedBlindedBlobSidecar struct {
|
|
||||||
Message *BlindedBlobSidecar `json:"message" validate:"required"`
|
|
||||||
Signature string `json:"signature" validate:"required"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type SignedBlobSidecar struct {
|
|
||||||
Message *BlobSidecar `json:"message" validate:"required"`
|
|
||||||
Signature string `json:"signature" validate:"required"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type BlindedBlobSidecar struct {
|
|
||||||
BlockRoot string `json:"block_root" validate:"required"`
|
|
||||||
Index string `json:"index" validate:"required"`
|
|
||||||
Slot string `json:"slot" validate:"required"`
|
|
||||||
BlockParentRoot string `json:"block_parent_root" validate:"required"`
|
|
||||||
ProposerIndex string `json:"proposer_index" validate:"required"`
|
|
||||||
BlobRoot string `json:"blob_root" validate:"required"`
|
|
||||||
KzgCommitment string `json:"kzg_commitment" validate:"required"` // pattern: "^0x[a-fA-F0-9]{96}$" ssz-size:"48"
|
|
||||||
KzgProof string `json:"kzg_proof" validate:"required"` // pattern: "^0x[a-fA-F0-9]{96}$" ssz-size:"48"
|
|
||||||
}
|
|
||||||
|
|
||||||
type BlobSidecar struct {
|
|
||||||
BlockRoot string `json:"block_root" validate:"required"`
|
|
||||||
Index string `json:"index" validate:"required"`
|
|
||||||
Slot string `json:"slot" validate:"required"`
|
|
||||||
BlockParentRoot string `json:"block_parent_root" validate:"required"`
|
|
||||||
ProposerIndex string `json:"proposer_index" validate:"required"`
|
|
||||||
Blob string `json:"blob" validate:"required"` // pattern: "^0x[a-fA-F0-9]{262144}$"
|
|
||||||
KzgCommitment string `json:"kzg_commitment" validate:"required"` // pattern: "^0x[a-fA-F0-9]{96}$" ssz-size:"48"
|
|
||||||
KzgProof string `json:"kzg_proof" validate:"required"` // pattern: "^0x[a-fA-F0-9]{96}$" ssz-size:"48"
|
|
||||||
}
|
|
||||||
|
|
||||||
type Eth1Data struct {
|
type Eth1Data struct {
|
||||||
DepositRoot string `json:"deposit_root" validate:"required"`
|
DepositRoot string `json:"deposit_root" validate:"required"`
|
||||||
DepositCount string `json:"deposit_count" validate:"required"`
|
DepositCount string `json:"deposit_count" validate:"required"`
|
||||||
|
|||||||
@@ -1166,40 +1166,37 @@ func (b *SignedBeaconBlockContentsDeneb) ToGeneric() (*eth.GenericSignedBeaconBl
|
|||||||
return nil, errNilValue
|
return nil, errNilValue
|
||||||
}
|
}
|
||||||
|
|
||||||
var signedBlobSidecars []*eth.SignedBlobSidecar
|
|
||||||
if len(b.SignedBlobSidecars) != 0 {
|
|
||||||
err := VerifyMaxLength(b.SignedBlobSidecars, fieldparams.MaxBlobsPerBlock)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "SignedBlobSidecars")
|
|
||||||
}
|
|
||||||
signedBlobSidecars = make([]*eth.SignedBlobSidecar, len(b.SignedBlobSidecars))
|
|
||||||
for i := range b.SignedBlobSidecars {
|
|
||||||
signedBlob, err := b.SignedBlobSidecars[i].ToConsensus()
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, fmt.Sprintf("SignedBlobSidecars[%d]", i))
|
|
||||||
}
|
|
||||||
signedBlobSidecars[i] = signedBlob
|
|
||||||
}
|
|
||||||
}
|
|
||||||
signedDenebBlock, err := b.SignedBlock.ToConsensus()
|
signedDenebBlock, err := b.SignedBlock.ToConsensus()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, NewDecodeError(err, "SignedBlock")
|
return nil, NewDecodeError(err, "SignedBlock")
|
||||||
}
|
}
|
||||||
|
proofs := make([][]byte, len(b.KzgProofs))
|
||||||
return ð.GenericSignedBeaconBlock{Block: ð.GenericSignedBeaconBlock_Deneb{Deneb: signedDenebBlock}}, nil
|
for i, proof := range b.KzgProofs {
|
||||||
|
proofs[i], err = DecodeHexWithLength(proof, fieldparams.BLSPubkeyLength)
|
||||||
|
if err != nil {
|
||||||
|
return nil, NewDecodeError(err, fmt.Sprintf("KzgProofs[%d]", i))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
blbs := make([][]byte, len(b.Blobs))
|
||||||
|
for i, blob := range b.Blobs {
|
||||||
|
blbs[i], err = DecodeHexWithLength(blob, fieldparams.BlobLength)
|
||||||
|
if err != nil {
|
||||||
|
return nil, NewDecodeError(err, fmt.Sprintf("Blobs[%d]", i))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
blk := ð.SignedBeaconBlockContentsDeneb{
|
||||||
|
Block: signedDenebBlock,
|
||||||
|
KzgProofs: proofs,
|
||||||
|
Blobs: blbs,
|
||||||
|
}
|
||||||
|
return ð.GenericSignedBeaconBlock{Block: ð.GenericSignedBeaconBlock_Deneb{Deneb: blk}}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *SignedBeaconBlockContentsDeneb) ToUnsigned() *BeaconBlockContentsDeneb {
|
func (b *SignedBeaconBlockContentsDeneb) ToUnsigned() *BeaconBlockContentsDeneb {
|
||||||
var blobSidecars []*BlobSidecar
|
|
||||||
if len(b.SignedBlobSidecars) != 0 {
|
|
||||||
blobSidecars = make([]*BlobSidecar, len(b.SignedBlobSidecars))
|
|
||||||
for i, s := range b.SignedBlobSidecars {
|
|
||||||
blobSidecars[i] = s.Message
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return &BeaconBlockContentsDeneb{
|
return &BeaconBlockContentsDeneb{
|
||||||
Block: b.SignedBlock.Message,
|
Block: b.SignedBlock.Message,
|
||||||
BlobSidecars: blobSidecars,
|
KzgProofs: b.KzgProofs,
|
||||||
|
Blobs: b.Blobs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1209,115 +1206,39 @@ func (b *BeaconBlockContentsDeneb) ToGeneric() (*eth.GenericBeaconBlock, error)
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return ð.GenericBeaconBlock{Block: ð.GenericBeaconBlock_Deneb{Deneb: block.Block}}, nil
|
return ð.GenericBeaconBlock{Block: ð.GenericBeaconBlock_Deneb{Deneb: block}}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BeaconBlockContentsDeneb) ToConsensus() (*eth.BeaconBlockAndBlobsDeneb, error) {
|
func (b *BeaconBlockContentsDeneb) ToConsensus() (*eth.BeaconBlockContentsDeneb, error) {
|
||||||
if b == nil {
|
if b == nil {
|
||||||
return nil, errNilValue
|
return nil, errNilValue
|
||||||
}
|
}
|
||||||
|
|
||||||
var blobSidecars []*eth.DeprecatedBlobSidecar
|
|
||||||
if len(b.BlobSidecars) != 0 {
|
|
||||||
err := VerifyMaxLength(b.BlobSidecars, fieldparams.MaxBlobsPerBlock)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "BlobSidecars")
|
|
||||||
}
|
|
||||||
blobSidecars = make([]*eth.DeprecatedBlobSidecar, len(b.BlobSidecars))
|
|
||||||
for i := range b.BlobSidecars {
|
|
||||||
blob, err := b.BlobSidecars[i].ToConsensus()
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, fmt.Sprintf("BlobSidecars[%d]", i))
|
|
||||||
}
|
|
||||||
blobSidecars[i] = blob
|
|
||||||
}
|
|
||||||
}
|
|
||||||
denebBlock, err := b.Block.ToConsensus()
|
denebBlock, err := b.Block.ToConsensus()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, NewDecodeError(err, "Block")
|
return nil, NewDecodeError(err, "Block")
|
||||||
}
|
}
|
||||||
return ð.BeaconBlockAndBlobsDeneb{
|
proofs := make([][]byte, len(b.KzgProofs))
|
||||||
Block: denebBlock,
|
for i, proof := range b.KzgProofs {
|
||||||
Blobs: blobSidecars,
|
proofs[i], err = DecodeHexWithLength(proof, fieldparams.BLSPubkeyLength)
|
||||||
|
if err != nil {
|
||||||
|
return nil, NewDecodeError(err, fmt.Sprintf("KzgProofs[%d]", i))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
blbs := make([][]byte, len(b.Blobs))
|
||||||
|
for i, blob := range b.Blobs {
|
||||||
|
blbs[i], err = DecodeHexWithLength(blob, fieldparams.BlobLength)
|
||||||
|
if err != nil {
|
||||||
|
return nil, NewDecodeError(err, fmt.Sprintf("Blobs[%d]", i))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ð.BeaconBlockContentsDeneb{
|
||||||
|
Block: denebBlock,
|
||||||
|
KzgProofs: proofs,
|
||||||
|
Blobs: blbs,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *SignedBlindedBeaconBlockContentsDeneb) ToGeneric() (*eth.GenericSignedBeaconBlock, error) {
|
|
||||||
if b == nil {
|
|
||||||
return nil, errNilValue
|
|
||||||
}
|
|
||||||
|
|
||||||
var signedBlindedBlobSidecars []*eth.SignedBlindedBlobSidecar
|
|
||||||
if len(b.SignedBlindedBlobSidecars) != 0 {
|
|
||||||
err := VerifyMaxLength(b.SignedBlindedBlobSidecars, fieldparams.MaxBlobsPerBlock)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "SignedBlindedBlobSidecars")
|
|
||||||
}
|
|
||||||
signedBlindedBlobSidecars = make([]*eth.SignedBlindedBlobSidecar, len(b.SignedBlindedBlobSidecars))
|
|
||||||
for i := range b.SignedBlindedBlobSidecars {
|
|
||||||
signedBlob, err := b.SignedBlindedBlobSidecars[i].ToConsensus()
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, fmt.Sprintf("SignedBlindedBlobSidecars[%d]", i))
|
|
||||||
}
|
|
||||||
signedBlindedBlobSidecars[i] = signedBlob
|
|
||||||
}
|
|
||||||
}
|
|
||||||
signedBlindedBlock, err := b.SignedBlindedBlock.ToConsensus()
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "SignedBlindedBlock")
|
|
||||||
}
|
|
||||||
block := ð.SignedBlindedBeaconBlockAndBlobsDeneb{
|
|
||||||
SignedBlindedBlock: signedBlindedBlock,
|
|
||||||
SignedBlindedBlobSidecars: signedBlindedBlobSidecars,
|
|
||||||
}
|
|
||||||
return ð.GenericSignedBeaconBlock{Block: ð.GenericSignedBeaconBlock_BlindedDeneb{BlindedDeneb: block}, IsBlinded: true, PayloadValue: 0 /* can't get payload value from blinded block */}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *SignedBlindedBeaconBlockContentsDeneb) ToUnsigned() *BlindedBeaconBlockContentsDeneb {
|
|
||||||
var blobSidecars []*BlindedBlobSidecar
|
|
||||||
if len(b.SignedBlindedBlobSidecars) != 0 {
|
|
||||||
blobSidecars = make([]*BlindedBlobSidecar, len(b.SignedBlindedBlobSidecars))
|
|
||||||
for i := range b.SignedBlindedBlobSidecars {
|
|
||||||
blobSidecars[i] = b.SignedBlindedBlobSidecars[i].Message
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return &BlindedBeaconBlockContentsDeneb{
|
|
||||||
BlindedBlock: b.SignedBlindedBlock.Message,
|
|
||||||
BlindedBlobSidecars: blobSidecars,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *BlindedBeaconBlockContentsDeneb) ToGeneric() (*eth.GenericBeaconBlock, error) {
|
|
||||||
if b == nil {
|
|
||||||
return nil, errNilValue
|
|
||||||
}
|
|
||||||
|
|
||||||
var blindedBlobSidecars []*eth.BlindedBlobSidecar
|
|
||||||
if len(b.BlindedBlobSidecars) != 0 {
|
|
||||||
err := VerifyMaxLength(b.BlindedBlobSidecars, fieldparams.MaxBlobsPerBlock)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "BlindedBlobSidecars")
|
|
||||||
}
|
|
||||||
blindedBlobSidecars = make([]*eth.BlindedBlobSidecar, len(b.BlindedBlobSidecars))
|
|
||||||
for i := range b.BlindedBlobSidecars {
|
|
||||||
blob, err := b.BlindedBlobSidecars[i].ToConsensus()
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, fmt.Sprintf("BlindedBlobSidecars[%d]", i))
|
|
||||||
}
|
|
||||||
blindedBlobSidecars[i] = blob
|
|
||||||
}
|
|
||||||
}
|
|
||||||
blindedBlock, err := b.BlindedBlock.ToConsensus()
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "BlindedBlock")
|
|
||||||
}
|
|
||||||
block := ð.BlindedBeaconBlockAndBlobsDeneb{
|
|
||||||
Block: blindedBlock,
|
|
||||||
Blobs: blindedBlobSidecars,
|
|
||||||
}
|
|
||||||
return ð.GenericBeaconBlock{Block: ð.GenericBeaconBlock_BlindedDeneb{BlindedDeneb: block}, IsBlinded: true, PayloadValue: 0 /* can't get payload value from blinded block */}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *BeaconBlockDeneb) ToConsensus() (*eth.BeaconBlockDeneb, error) {
|
func (b *BeaconBlockDeneb) ToConsensus() (*eth.BeaconBlockDeneb, error) {
|
||||||
if b == nil {
|
if b == nil {
|
||||||
return nil, errNilValue
|
return nil, errNilValue
|
||||||
@@ -1563,55 +1484,6 @@ func (b *BeaconBlockDeneb) ToConsensus() (*eth.BeaconBlockDeneb, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *BlobSidecar) ToConsensus() (*eth.DeprecatedBlobSidecar, error) {
|
|
||||||
if s == nil {
|
|
||||||
return nil, errNilValue
|
|
||||||
}
|
|
||||||
blockRoot, err := DecodeHexWithLength(s.BlockRoot, fieldparams.RootLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "BlockRoot")
|
|
||||||
}
|
|
||||||
index, err := strconv.ParseUint(s.Index, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Index")
|
|
||||||
}
|
|
||||||
slot, err := strconv.ParseUint(s.Slot, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Slot")
|
|
||||||
}
|
|
||||||
blockParentRoot, err := DecodeHexWithLength(s.BlockParentRoot, fieldparams.RootLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "BlockParentRoot")
|
|
||||||
}
|
|
||||||
proposerIndex, err := strconv.ParseUint(s.ProposerIndex, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "ProposerIndex")
|
|
||||||
}
|
|
||||||
blob, err := DecodeHexWithLength(s.Blob, fieldparams.BlobLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Blob")
|
|
||||||
}
|
|
||||||
kzgCommitment, err := DecodeHexWithLength(s.KzgCommitment, fieldparams.BLSPubkeyLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "KzgCommitment")
|
|
||||||
}
|
|
||||||
kzgProof, err := DecodeHexWithLength(s.KzgProof, fieldparams.BLSPubkeyLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "KzgProof")
|
|
||||||
}
|
|
||||||
bsc := ð.DeprecatedBlobSidecar{
|
|
||||||
BlockRoot: blockRoot,
|
|
||||||
Index: index,
|
|
||||||
Slot: primitives.Slot(slot),
|
|
||||||
BlockParentRoot: blockParentRoot,
|
|
||||||
ProposerIndex: primitives.ValidatorIndex(proposerIndex),
|
|
||||||
Blob: blob,
|
|
||||||
KzgCommitment: kzgCommitment,
|
|
||||||
KzgProof: kzgProof,
|
|
||||||
}
|
|
||||||
return bsc, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *SignedBeaconBlockDeneb) ToConsensus() (*eth.SignedBeaconBlockDeneb, error) {
|
func (b *SignedBeaconBlockDeneb) ToConsensus() (*eth.SignedBeaconBlockDeneb, error) {
|
||||||
if b == nil {
|
if b == nil {
|
||||||
return nil, errNilValue
|
return nil, errNilValue
|
||||||
@@ -1631,66 +1503,6 @@ func (b *SignedBeaconBlockDeneb) ToConsensus() (*eth.SignedBeaconBlockDeneb, err
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SignedBlobSidecar) ToConsensus() (*eth.SignedBlobSidecar, error) {
|
|
||||||
if s == nil {
|
|
||||||
return nil, errNilValue
|
|
||||||
}
|
|
||||||
if s.Message == nil {
|
|
||||||
return nil, NewDecodeError(errNilValue, "Message")
|
|
||||||
}
|
|
||||||
|
|
||||||
blobSig, err := DecodeHexWithLength(s.Signature, fieldparams.BLSSignatureLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Signature")
|
|
||||||
}
|
|
||||||
blockRoot, err := DecodeHexWithLength(s.Message.BlockRoot, fieldparams.RootLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Message.BlockRoot")
|
|
||||||
}
|
|
||||||
index, err := strconv.ParseUint(s.Message.Index, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Message.Index")
|
|
||||||
}
|
|
||||||
slot, err := strconv.ParseUint(s.Message.Slot, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Message.Slot")
|
|
||||||
}
|
|
||||||
blockParentRoot, err := DecodeHexWithLength(s.Message.BlockParentRoot, fieldparams.RootLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Message.BlockParentRoot")
|
|
||||||
}
|
|
||||||
proposerIndex, err := strconv.ParseUint(s.Message.ProposerIndex, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Message.ProposerIndex")
|
|
||||||
}
|
|
||||||
blob, err := DecodeHexWithLength(s.Message.Blob, fieldparams.BlobLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Message.Blob")
|
|
||||||
}
|
|
||||||
kzgCommitment, err := DecodeHexWithLength(s.Message.KzgCommitment, fieldparams.BLSPubkeyLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Message.KzgCommitment")
|
|
||||||
}
|
|
||||||
kzgProof, err := DecodeHexWithLength(s.Message.KzgProof, fieldparams.BLSPubkeyLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Message.KzgProof")
|
|
||||||
}
|
|
||||||
bsc := ð.DeprecatedBlobSidecar{
|
|
||||||
BlockRoot: blockRoot,
|
|
||||||
Index: index,
|
|
||||||
Slot: primitives.Slot(slot),
|
|
||||||
BlockParentRoot: blockParentRoot,
|
|
||||||
ProposerIndex: primitives.ValidatorIndex(proposerIndex),
|
|
||||||
Blob: blob,
|
|
||||||
KzgCommitment: kzgCommitment,
|
|
||||||
KzgProof: kzgProof,
|
|
||||||
}
|
|
||||||
return ð.SignedBlobSidecar{
|
|
||||||
Message: bsc,
|
|
||||||
Signature: blobSig,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *SignedBlindedBeaconBlockDeneb) ToConsensus() (*eth.SignedBlindedBeaconBlockDeneb, error) {
|
func (b *SignedBlindedBeaconBlockDeneb) ToConsensus() (*eth.SignedBlindedBeaconBlockDeneb, error) {
|
||||||
if b == nil {
|
if b == nil {
|
||||||
return nil, errNilValue
|
return nil, errNilValue
|
||||||
@@ -1710,6 +1522,24 @@ func (b *SignedBlindedBeaconBlockDeneb) ToConsensus() (*eth.SignedBlindedBeaconB
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *SignedBlindedBeaconBlockDeneb) ToGeneric() (*eth.GenericSignedBeaconBlock, error) {
|
||||||
|
if b == nil {
|
||||||
|
return nil, errNilValue
|
||||||
|
}
|
||||||
|
sig, err := DecodeHexWithLength(b.Signature, fieldparams.BLSSignatureLength)
|
||||||
|
if err != nil {
|
||||||
|
return nil, NewDecodeError(err, "Signature")
|
||||||
|
}
|
||||||
|
blindedBlock, err := b.Message.ToConsensus()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return ð.GenericSignedBeaconBlock{Block: ð.GenericSignedBeaconBlock_BlindedDeneb{BlindedDeneb: ð.SignedBlindedBeaconBlockDeneb{
|
||||||
|
Message: blindedBlock,
|
||||||
|
Signature: sig,
|
||||||
|
}}, IsBlinded: true}, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (b *BlindedBeaconBlockDeneb) ToConsensus() (*eth.BlindedBeaconBlockDeneb, error) {
|
func (b *BlindedBeaconBlockDeneb) ToConsensus() (*eth.BlindedBeaconBlockDeneb, error) {
|
||||||
if b == nil {
|
if b == nil {
|
||||||
return nil, errNilValue
|
return nil, errNilValue
|
||||||
@@ -1925,72 +1755,16 @@ func (b *BlindedBeaconBlockDeneb) ToConsensus() (*eth.BlindedBeaconBlockDeneb, e
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SignedBlindedBlobSidecar) ToConsensus() (*eth.SignedBlindedBlobSidecar, error) {
|
func (b *BlindedBeaconBlockDeneb) ToGeneric() (*eth.GenericBeaconBlock, error) {
|
||||||
if s == nil {
|
if b == nil {
|
||||||
return nil, errNilValue
|
return nil, errNilValue
|
||||||
}
|
}
|
||||||
|
|
||||||
blobSig, err := DecodeHexWithLength(s.Signature, fieldparams.BLSSignatureLength)
|
blindedBlock, err := b.ToConsensus()
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Signature")
|
|
||||||
}
|
|
||||||
bsc, err := s.Message.ToConsensus()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return ð.SignedBlindedBlobSidecar{
|
return ð.GenericBeaconBlock{Block: ð.GenericBeaconBlock_BlindedDeneb{BlindedDeneb: blindedBlock}, IsBlinded: true}, nil
|
||||||
Message: bsc,
|
|
||||||
Signature: blobSig,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *BlindedBlobSidecar) ToConsensus() (*eth.BlindedBlobSidecar, error) {
|
|
||||||
if s == nil {
|
|
||||||
return nil, errNilValue
|
|
||||||
}
|
|
||||||
blockRoot, err := DecodeHexWithLength(s.BlockRoot, fieldparams.RootLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "BlockRoot")
|
|
||||||
}
|
|
||||||
index, err := strconv.ParseUint(s.Index, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Index")
|
|
||||||
}
|
|
||||||
denebSlot, err := strconv.ParseUint(s.Slot, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "Slot")
|
|
||||||
}
|
|
||||||
blockParentRoot, err := DecodeHexWithLength(s.BlockParentRoot, fieldparams.RootLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "BlockParentRoot")
|
|
||||||
}
|
|
||||||
proposerIndex, err := strconv.ParseUint(s.ProposerIndex, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "ProposerIndex")
|
|
||||||
}
|
|
||||||
blobRoot, err := DecodeHexWithLength(s.BlobRoot, fieldparams.RootLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "BlobRoot")
|
|
||||||
}
|
|
||||||
kzgCommitment, err := DecodeHexWithLength(s.KzgCommitment, fieldparams.BLSPubkeyLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "KzgCommitment")
|
|
||||||
}
|
|
||||||
kzgProof, err := DecodeHexWithLength(s.KzgProof, fieldparams.BLSPubkeyLength)
|
|
||||||
if err != nil {
|
|
||||||
return nil, NewDecodeError(err, "KzgProof")
|
|
||||||
}
|
|
||||||
bsc := ð.BlindedBlobSidecar{
|
|
||||||
BlockRoot: blockRoot,
|
|
||||||
Index: index,
|
|
||||||
Slot: primitives.Slot(denebSlot),
|
|
||||||
BlockParentRoot: blockParentRoot,
|
|
||||||
ProposerIndex: primitives.ValidatorIndex(proposerIndex),
|
|
||||||
BlobRoot: blobRoot,
|
|
||||||
KzgCommitment: kzgCommitment,
|
|
||||||
KzgProof: kzgProof,
|
|
||||||
}
|
|
||||||
return bsc, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func BeaconBlockHeaderFromConsensus(h *eth.BeaconBlockHeader) *BeaconBlockHeader {
|
func BeaconBlockHeaderFromConsensus(h *eth.BeaconBlockHeader) *BeaconBlockHeader {
|
||||||
@@ -2395,69 +2169,46 @@ func SignedBeaconBlockCapellaFromConsensus(b *eth.SignedBeaconBlockCapella) (*Si
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func BlindedBeaconBlockContentsDenebFromConsensus(b *eth.BlindedBeaconBlockAndBlobsDeneb) (*BlindedBeaconBlockContentsDeneb, error) {
|
func BeaconBlockContentsDenebFromConsensus(b *eth.BeaconBlockContentsDeneb) (*BeaconBlockContentsDeneb, error) {
|
||||||
var blindedBlobSidecars []*BlindedBlobSidecar
|
|
||||||
if len(b.Blobs) != 0 {
|
|
||||||
blindedBlobSidecars = make([]*BlindedBlobSidecar, len(b.Blobs))
|
|
||||||
for i, s := range b.Blobs {
|
|
||||||
signedBlob, err := BlindedBlobSidecarFromConsensus(s)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
blindedBlobSidecars[i] = signedBlob
|
|
||||||
}
|
|
||||||
}
|
|
||||||
blindedBlock, err := BlindedBeaconBlockDenebFromConsensus(b.Block)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &BlindedBeaconBlockContentsDeneb{
|
|
||||||
BlindedBlock: blindedBlock,
|
|
||||||
BlindedBlobSidecars: blindedBlobSidecars,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func BeaconBlockContentsDenebFromConsensus(b *eth.BeaconBlockAndBlobsDeneb) (*BeaconBlockContentsDeneb, error) {
|
|
||||||
var blobSidecars []*BlobSidecar
|
|
||||||
if len(b.Blobs) != 0 {
|
|
||||||
blobSidecars = make([]*BlobSidecar, len(b.Blobs))
|
|
||||||
for i, s := range b.Blobs {
|
|
||||||
blob, err := BlobSidecarFromConsensus(s)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
blobSidecars[i] = blob
|
|
||||||
}
|
|
||||||
}
|
|
||||||
block, err := BeaconBlockDenebFromConsensus(b.Block)
|
block, err := BeaconBlockDenebFromConsensus(b.Block)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
proofs := make([]string, len(b.KzgProofs))
|
||||||
|
for i, proof := range b.KzgProofs {
|
||||||
|
proofs[i] = hexutil.Encode(proof)
|
||||||
|
}
|
||||||
|
blbs := make([]string, len(b.Blobs))
|
||||||
|
for i, blob := range b.Blobs {
|
||||||
|
blbs[i] = hexutil.Encode(blob)
|
||||||
|
}
|
||||||
return &BeaconBlockContentsDeneb{
|
return &BeaconBlockContentsDeneb{
|
||||||
Block: block,
|
Block: block,
|
||||||
BlobSidecars: blobSidecars,
|
KzgProofs: proofs,
|
||||||
|
Blobs: blbs,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SignedBeaconBlockContentsDenebFromConsensus(b *eth.SignedBeaconBlockAndBlobsDeneb) (*SignedBeaconBlockContentsDeneb, error) {
|
func SignedBeaconBlockContentsDenebFromConsensus(b *eth.SignedBeaconBlockContentsDeneb) (*SignedBeaconBlockContentsDeneb, error) {
|
||||||
var blobSidecars []*SignedBlobSidecar
|
|
||||||
if len(b.Blobs) != 0 {
|
|
||||||
blobSidecars = make([]*SignedBlobSidecar, len(b.Blobs))
|
|
||||||
for i, s := range b.Blobs {
|
|
||||||
blob, err := SignedBlobSidecarFromConsensus(s)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
blobSidecars[i] = blob
|
|
||||||
}
|
|
||||||
}
|
|
||||||
block, err := SignedBeaconBlockDenebFromConsensus(b.Block)
|
block, err := SignedBeaconBlockDenebFromConsensus(b.Block)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proofs := make([]string, len(b.KzgProofs))
|
||||||
|
for i, proof := range b.KzgProofs {
|
||||||
|
proofs[i] = hexutil.Encode(proof)
|
||||||
|
}
|
||||||
|
|
||||||
|
blbs := make([]string, len(b.Blobs))
|
||||||
|
for i, blob := range b.Blobs {
|
||||||
|
blbs[i] = hexutil.Encode(blob)
|
||||||
|
}
|
||||||
|
|
||||||
return &SignedBeaconBlockContentsDeneb{
|
return &SignedBeaconBlockContentsDeneb{
|
||||||
SignedBlock: block,
|
SignedBlock: block,
|
||||||
SignedBlobSidecars: blobSidecars,
|
KzgProofs: proofs,
|
||||||
|
Blobs: blbs,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2628,54 +2379,6 @@ func SignedBeaconBlockDenebFromConsensus(b *eth.SignedBeaconBlockDeneb) (*Signed
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func BlindedBlobSidecarFromConsensus(b *eth.BlindedBlobSidecar) (*BlindedBlobSidecar, error) {
|
|
||||||
return &BlindedBlobSidecar{
|
|
||||||
BlockRoot: hexutil.Encode(b.BlockRoot),
|
|
||||||
Index: fmt.Sprintf("%d", b.Index),
|
|
||||||
Slot: fmt.Sprintf("%d", b.Slot),
|
|
||||||
BlockParentRoot: hexutil.Encode(b.BlockParentRoot),
|
|
||||||
ProposerIndex: fmt.Sprintf("%d", b.ProposerIndex),
|
|
||||||
BlobRoot: hexutil.Encode(b.BlobRoot),
|
|
||||||
KzgCommitment: hexutil.Encode(b.KzgCommitment),
|
|
||||||
KzgProof: hexutil.Encode(b.KzgProof),
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func SignedBlindedBlobSidecarFromConsensus(b *eth.SignedBlindedBlobSidecar) (*SignedBlindedBlobSidecar, error) {
|
|
||||||
blobSidecar, err := BlindedBlobSidecarFromConsensus(b.Message)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &SignedBlindedBlobSidecar{
|
|
||||||
Message: blobSidecar,
|
|
||||||
Signature: hexutil.Encode(b.Signature),
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func BlobSidecarFromConsensus(b *eth.DeprecatedBlobSidecar) (*BlobSidecar, error) {
|
|
||||||
return &BlobSidecar{
|
|
||||||
BlockRoot: hexutil.Encode(b.BlockRoot),
|
|
||||||
Index: fmt.Sprintf("%d", b.Index),
|
|
||||||
Slot: fmt.Sprintf("%d", b.Slot),
|
|
||||||
BlockParentRoot: hexutil.Encode(b.BlockParentRoot),
|
|
||||||
ProposerIndex: fmt.Sprintf("%d", b.ProposerIndex),
|
|
||||||
Blob: hexutil.Encode(b.Blob),
|
|
||||||
KzgCommitment: hexutil.Encode(b.KzgCommitment),
|
|
||||||
KzgProof: hexutil.Encode(b.KzgProof),
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func SignedBlobSidecarFromConsensus(b *eth.SignedBlobSidecar) (*SignedBlobSidecar, error) {
|
|
||||||
blobSidecar, err := BlobSidecarFromConsensus(b.Message)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &SignedBlobSidecar{
|
|
||||||
Message: blobSidecar,
|
|
||||||
Signature: hexutil.Encode(b.Signature),
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func ProposerSlashingsToConsensus(src []*ProposerSlashing) ([]*eth.ProposerSlashing, error) {
|
func ProposerSlashingsToConsensus(src []*ProposerSlashing) ([]*eth.ProposerSlashing, error) {
|
||||||
if src == nil {
|
if src == nil {
|
||||||
return nil, errNilValue
|
return nil, errNilValue
|
||||||
@@ -2776,30 +2479,25 @@ func ProposerSlashingsToConsensus(src []*ProposerSlashing) ([]*eth.ProposerSlash
|
|||||||
return proposerSlashings, nil
|
return proposerSlashings, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SignedBeaconBlockHeaderFromConsensus(src *eth.SignedBeaconBlockHeader) *SignedBeaconBlockHeader {
|
||||||
|
return &SignedBeaconBlockHeader{
|
||||||
|
Message: &BeaconBlockHeader{
|
||||||
|
Slot: fmt.Sprintf("%d", src.Header.Slot),
|
||||||
|
ProposerIndex: fmt.Sprintf("%d", src.Header.ProposerIndex),
|
||||||
|
ParentRoot: hexutil.Encode(src.Header.ParentRoot),
|
||||||
|
StateRoot: hexutil.Encode(src.Header.StateRoot),
|
||||||
|
BodyRoot: hexutil.Encode(src.Header.BodyRoot),
|
||||||
|
},
|
||||||
|
Signature: hexutil.Encode(src.Signature),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func ProposerSlashingsFromConsensus(src []*eth.ProposerSlashing) []*ProposerSlashing {
|
func ProposerSlashingsFromConsensus(src []*eth.ProposerSlashing) []*ProposerSlashing {
|
||||||
proposerSlashings := make([]*ProposerSlashing, len(src))
|
proposerSlashings := make([]*ProposerSlashing, len(src))
|
||||||
for i, s := range src {
|
for i, s := range src {
|
||||||
proposerSlashings[i] = &ProposerSlashing{
|
proposerSlashings[i] = &ProposerSlashing{
|
||||||
SignedHeader1: &SignedBeaconBlockHeader{
|
SignedHeader1: SignedBeaconBlockHeaderFromConsensus(s.Header_1),
|
||||||
Message: &BeaconBlockHeader{
|
SignedHeader2: SignedBeaconBlockHeaderFromConsensus(s.Header_2),
|
||||||
Slot: fmt.Sprintf("%d", s.Header_1.Header.Slot),
|
|
||||||
ProposerIndex: fmt.Sprintf("%d", s.Header_1.Header.ProposerIndex),
|
|
||||||
ParentRoot: hexutil.Encode(s.Header_1.Header.ParentRoot),
|
|
||||||
StateRoot: hexutil.Encode(s.Header_1.Header.StateRoot),
|
|
||||||
BodyRoot: hexutil.Encode(s.Header_1.Header.BodyRoot),
|
|
||||||
},
|
|
||||||
Signature: hexutil.Encode(s.Header_1.Signature),
|
|
||||||
},
|
|
||||||
SignedHeader2: &SignedBeaconBlockHeader{
|
|
||||||
Message: &BeaconBlockHeader{
|
|
||||||
Slot: fmt.Sprintf("%d", s.Header_2.Header.Slot),
|
|
||||||
ProposerIndex: fmt.Sprintf("%d", s.Header_2.Header.ProposerIndex),
|
|
||||||
ParentRoot: hexutil.Encode(s.Header_2.Header.ParentRoot),
|
|
||||||
StateRoot: hexutil.Encode(s.Header_2.Header.StateRoot),
|
|
||||||
BodyRoot: hexutil.Encode(s.Header_2.Header.BodyRoot),
|
|
||||||
},
|
|
||||||
Signature: hexutil.Encode(s.Header_2.Signature),
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return proposerSlashings
|
return proposerSlashings
|
||||||
|
|||||||
@@ -6,5 +6,4 @@ go_library(
|
|||||||
srcs = ["json.go"],
|
srcs = ["json.go"],
|
||||||
importpath = "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared/testing",
|
importpath = "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared/testing",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = ["@com_github_ethereum_go_ethereum//common/hexutil:go_default_library"],
|
|
||||||
)
|
)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -295,11 +295,10 @@ func getConsensusBlockValue(ctx context.Context, blockRewardsFetcher rewards.Blo
|
|||||||
case *eth.GenericBeaconBlock_BlindedCapella:
|
case *eth.GenericBeaconBlock_BlindedCapella:
|
||||||
wrapper, err = blocks.NewSignedBeaconBlock(ð.GenericSignedBeaconBlock_BlindedCapella{BlindedCapella: ð.SignedBlindedBeaconBlockCapella{Block: b.BlindedCapella}})
|
wrapper, err = blocks.NewSignedBeaconBlock(ð.GenericSignedBeaconBlock_BlindedCapella{BlindedCapella: ð.SignedBlindedBeaconBlockCapella{Block: b.BlindedCapella}})
|
||||||
case *eth.GenericBeaconBlock_Deneb:
|
case *eth.GenericBeaconBlock_Deneb:
|
||||||
// no need for sidecar
|
// no need for blobs
|
||||||
wrapper, err = blocks.NewSignedBeaconBlock(ð.GenericSignedBeaconBlock_Deneb{Deneb: ð.SignedBeaconBlockDeneb{Block: b.Deneb}})
|
wrapper, err = blocks.NewSignedBeaconBlock(ð.GenericSignedBeaconBlock_Deneb{Deneb: ð.SignedBeaconBlockContentsDeneb{Block: ð.SignedBeaconBlockDeneb{Block: b.Deneb.Block}}})
|
||||||
case *eth.GenericBeaconBlock_BlindedDeneb:
|
case *eth.GenericBeaconBlock_BlindedDeneb:
|
||||||
// no need for sidecar
|
wrapper, err = blocks.NewSignedBeaconBlock(ð.GenericSignedBeaconBlock_BlindedDeneb{BlindedDeneb: ð.SignedBlindedBeaconBlockDeneb{Message: b.BlindedDeneb}})
|
||||||
wrapper, err = blocks.NewSignedBeaconBlock(ð.GenericSignedBeaconBlock_BlindedDeneb{BlindedDeneb: ð.SignedBlindedBeaconBlockAndBlobsDeneb{SignedBlindedBlock: ð.SignedBlindedBeaconBlockDeneb{Message: b.BlindedDeneb.Block}}})
|
|
||||||
default:
|
default:
|
||||||
return "", &http2.DefaultErrorJson{
|
return "", &http2.DefaultErrorJson{
|
||||||
Message: fmt.Errorf("type %T is not supported", b).Error(),
|
Message: fmt.Errorf("type %T is not supported", b).Error(),
|
||||||
@@ -546,12 +545,12 @@ func handleProduceBlindedDenebV3(
|
|||||||
http2.WriteSsz(w, sszResp, "blindedDenebBlockContents.ssz")
|
http2.WriteSsz(w, sszResp, "blindedDenebBlockContents.ssz")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
blockContents, err := shared.BlindedBeaconBlockContentsDenebFromConsensus(blk.BlindedDeneb)
|
blindedBlock, err := shared.BlindedBeaconBlockDenebFromConsensus(blk.BlindedDeneb)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http2.HandleError(w, err.Error(), http.StatusInternalServerError)
|
http2.HandleError(w, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
jsonBytes, err := json.Marshal(blockContents)
|
jsonBytes, err := json.Marshal(blindedBlock)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http2.HandleError(w, err.Error(), http.StatusInternalServerError)
|
http2.HandleError(w, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
@@ -582,8 +581,7 @@ func handleProduceDenebV3(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: We need to add blobs here for beacon api
|
blockContents, err := shared.BeaconBlockContentsDenebFromConsensus(blk.Deneb)
|
||||||
blockContents, err := shared.BeaconBlockContentsDenebFromConsensus(ð.BeaconBlockAndBlobsDeneb{Block: blk.Deneb})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http2.HandleError(w, err.Error(), http.StatusInternalServerError)
|
http2.HandleError(w, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -242,13 +242,13 @@ func TestProduceBlockV2(t *testing.T) {
|
|||||||
require.Equal(t, "deneb", writer.Header().Get(api.VersionHeader))
|
require.Equal(t, "deneb", writer.Header().Get(api.VersionHeader))
|
||||||
})
|
})
|
||||||
t.Run("Blinded Deneb", func(t *testing.T) {
|
t.Run("Blinded Deneb", func(t *testing.T) {
|
||||||
var block *shared.SignedBlindedBeaconBlockContentsDeneb
|
var block *shared.SignedBlindedBeaconBlockDeneb
|
||||||
err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlockContents), &block)
|
err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlock), &block)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
||||||
v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), gomock.Any()).Return(
|
v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), gomock.Any()).Return(
|
||||||
func() (*eth.GenericBeaconBlock, error) {
|
func() (*eth.GenericBeaconBlock, error) {
|
||||||
return block.ToUnsigned().ToGeneric()
|
return block.Message.ToGeneric()
|
||||||
}())
|
}())
|
||||||
mockChainService := &blockchainTesting.ChainService{}
|
mockChainService := &blockchainTesting.ChainService{}
|
||||||
mockRewards := &rewards.BlockRewards{Total: "10"}
|
mockRewards := &rewards.BlockRewards{Total: "10"}
|
||||||
@@ -553,13 +553,13 @@ func TestProduceBlockV2SSZ(t *testing.T) {
|
|||||||
require.Equal(t, "deneb", writer.Header().Get(api.VersionHeader))
|
require.Equal(t, "deneb", writer.Header().Get(api.VersionHeader))
|
||||||
})
|
})
|
||||||
t.Run("Blinded Deneb", func(t *testing.T) {
|
t.Run("Blinded Deneb", func(t *testing.T) {
|
||||||
var block *shared.SignedBlindedBeaconBlockContentsDeneb
|
var block *shared.SignedBlindedBeaconBlockDeneb
|
||||||
err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlockContents), &block)
|
err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlock), &block)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
||||||
v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), gomock.Any()).Return(
|
v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), gomock.Any()).Return(
|
||||||
func() (*eth.GenericBeaconBlock, error) {
|
func() (*eth.GenericBeaconBlock, error) {
|
||||||
return block.ToUnsigned().ToGeneric()
|
return block.Message.ToGeneric()
|
||||||
}())
|
}())
|
||||||
mockChainService := &blockchainTesting.ChainService{}
|
mockChainService := &blockchainTesting.ChainService{}
|
||||||
server := &Server{
|
server := &Server{
|
||||||
@@ -826,15 +826,15 @@ func TestProduceBlockV3(t *testing.T) {
|
|||||||
require.Equal(t, "10", writer.Header().Get(api.ConsensusBlockValueHeader))
|
require.Equal(t, "10", writer.Header().Get(api.ConsensusBlockValueHeader))
|
||||||
})
|
})
|
||||||
t.Run("Blinded Deneb", func(t *testing.T) {
|
t.Run("Blinded Deneb", func(t *testing.T) {
|
||||||
var block *shared.SignedBlindedBeaconBlockContentsDeneb
|
var block *shared.SignedBlindedBeaconBlockDeneb
|
||||||
err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlockContents), &block)
|
err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlock), &block)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
jsonBytes, err := json.Marshal(block.ToUnsigned())
|
jsonBytes, err := json.Marshal(block.Message)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
||||||
v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), gomock.Any()).Return(
|
v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), gomock.Any()).Return(
|
||||||
func() (*eth.GenericBeaconBlock, error) {
|
func() (*eth.GenericBeaconBlock, error) {
|
||||||
return block.ToUnsigned().ToGeneric()
|
return block.Message.ToGeneric()
|
||||||
}())
|
}())
|
||||||
mockChainService := &blockchainTesting.ChainService{}
|
mockChainService := &blockchainTesting.ChainService{}
|
||||||
mockRewards := &rewards.BlockRewards{Total: "10"}
|
mockRewards := &rewards.BlockRewards{Total: "10"}
|
||||||
@@ -1170,13 +1170,13 @@ func TestProduceBlockV3SSZ(t *testing.T) {
|
|||||||
require.Equal(t, "10", writer.Header().Get(api.ConsensusBlockValueHeader))
|
require.Equal(t, "10", writer.Header().Get(api.ConsensusBlockValueHeader))
|
||||||
})
|
})
|
||||||
t.Run("Blinded Deneb", func(t *testing.T) {
|
t.Run("Blinded Deneb", func(t *testing.T) {
|
||||||
var block *shared.SignedBlindedBeaconBlockContentsDeneb
|
var block *shared.SignedBlindedBeaconBlockDeneb
|
||||||
err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlockContents), &block)
|
err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlock), &block)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
v1alpha1Server := mock2.NewMockBeaconNodeValidatorServer(ctrl)
|
||||||
v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), gomock.Any()).Return(
|
v1alpha1Server.EXPECT().GetBeaconBlock(gomock.Any(), gomock.Any()).Return(
|
||||||
func() (*eth.GenericBeaconBlock, error) {
|
func() (*eth.GenericBeaconBlock, error) {
|
||||||
return block.ToUnsigned().ToGeneric()
|
return block.Message.ToGeneric()
|
||||||
}())
|
}())
|
||||||
mockChainService := &blockchainTesting.ChainService{}
|
mockChainService := &blockchainTesting.ChainService{}
|
||||||
server := &Server{
|
server := &Server{
|
||||||
@@ -1193,7 +1193,7 @@ func TestProduceBlockV3SSZ(t *testing.T) {
|
|||||||
writer.Body = &bytes.Buffer{}
|
writer.Body = &bytes.Buffer{}
|
||||||
server.ProduceBlockV3(writer, request)
|
server.ProduceBlockV3(writer, request)
|
||||||
assert.Equal(t, http.StatusOK, writer.Code)
|
assert.Equal(t, http.StatusOK, writer.Code)
|
||||||
g, err := block.ToUnsigned().ToGeneric()
|
g, err := block.Message.ToGeneric()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
bl, ok := g.Block.(*eth.GenericBeaconBlock_BlindedDeneb)
|
bl, ok := g.Block.(*eth.GenericBeaconBlock_BlindedDeneb)
|
||||||
require.Equal(t, true, ok)
|
require.Equal(t, true, ok)
|
||||||
|
|||||||
@@ -11,8 +11,11 @@ go_library(
|
|||||||
deps = [
|
deps = [
|
||||||
"//beacon-chain/blockchain:go_default_library",
|
"//beacon-chain/blockchain:go_default_library",
|
||||||
"//beacon-chain/db:go_default_library",
|
"//beacon-chain/db:go_default_library",
|
||||||
|
"//beacon-chain/db/filesystem:go_default_library",
|
||||||
|
"//beacon-chain/rpc/core:go_default_library",
|
||||||
"//beacon-chain/state:go_default_library",
|
"//beacon-chain/state:go_default_library",
|
||||||
"//beacon-chain/state/stategen:go_default_library",
|
"//beacon-chain/state/stategen:go_default_library",
|
||||||
|
"//config/fieldparams:go_default_library",
|
||||||
"//config/params:go_default_library",
|
"//config/params:go_default_library",
|
||||||
"//consensus-types/blocks:go_default_library",
|
"//consensus-types/blocks:go_default_library",
|
||||||
"//consensus-types/interfaces:go_default_library",
|
"//consensus-types/interfaces:go_default_library",
|
||||||
@@ -34,11 +37,14 @@ go_test(
|
|||||||
embed = [":go_default_library"],
|
embed = [":go_default_library"],
|
||||||
deps = [
|
deps = [
|
||||||
"//beacon-chain/blockchain/testing:go_default_library",
|
"//beacon-chain/blockchain/testing:go_default_library",
|
||||||
|
"//beacon-chain/db/filesystem:go_default_library",
|
||||||
"//beacon-chain/db/testing:go_default_library",
|
"//beacon-chain/db/testing:go_default_library",
|
||||||
|
"//beacon-chain/rpc/core:go_default_library",
|
||||||
"//beacon-chain/rpc/testutil:go_default_library",
|
"//beacon-chain/rpc/testutil:go_default_library",
|
||||||
"//beacon-chain/state/state-native:go_default_library",
|
"//beacon-chain/state/state-native:go_default_library",
|
||||||
"//beacon-chain/state/stategen:go_default_library",
|
"//beacon-chain/state/stategen:go_default_library",
|
||||||
"//beacon-chain/state/stategen/mock:go_default_library",
|
"//beacon-chain/state/stategen/mock:go_default_library",
|
||||||
|
"//beacon-chain/verification:go_default_library",
|
||||||
"//config/params:go_default_library",
|
"//config/params:go_default_library",
|
||||||
"//consensus-types/blocks:go_default_library",
|
"//consensus-types/blocks:go_default_library",
|
||||||
"//consensus-types/primitives:go_default_library",
|
"//consensus-types/primitives:go_default_library",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package lookup
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@@ -9,9 +10,15 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain"
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain"
|
||||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/db"
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/db"
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/db/filesystem"
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/core"
|
||||||
|
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/config/params"
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/blocks"
|
||||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/interfaces"
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/interfaces"
|
||||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
||||||
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
|
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/time/slots"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BlockIdParseError represents an error scenario where a block ID could not be parsed.
|
// BlockIdParseError represents an error scenario where a block ID could not be parsed.
|
||||||
@@ -34,12 +41,14 @@ func (e BlockIdParseError) Error() string {
|
|||||||
// Blocker is responsible for retrieving blocks.
|
// Blocker is responsible for retrieving blocks.
|
||||||
type Blocker interface {
|
type Blocker interface {
|
||||||
Block(ctx context.Context, id []byte) (interfaces.ReadOnlySignedBeaconBlock, error)
|
Block(ctx context.Context, id []byte) (interfaces.ReadOnlySignedBeaconBlock, error)
|
||||||
|
Blobs(ctx context.Context, id string, indices []uint64) ([]*blocks.VerifiedROBlob, *core.RpcError)
|
||||||
}
|
}
|
||||||
|
|
||||||
// BeaconDbBlocker is an implementation of Blocker. It retrieves blocks from the beacon chain database.
|
// BeaconDbBlocker is an implementation of Blocker. It retrieves blocks from the beacon chain database.
|
||||||
type BeaconDbBlocker struct {
|
type BeaconDbBlocker struct {
|
||||||
BeaconDB db.ReadOnlyDatabase
|
BeaconDB db.ReadOnlyDatabase
|
||||||
ChainInfoFetcher blockchain.ChainInfoFetcher
|
ChainInfoFetcher blockchain.ChainInfoFetcher
|
||||||
|
BlobStorage *filesystem.BlobStorage
|
||||||
}
|
}
|
||||||
|
|
||||||
// Block returns the beacon block for a given identifier. The identifier can be one of:
|
// Block returns the beacon block for a given identifier. The identifier can be one of:
|
||||||
@@ -120,3 +129,107 @@ func (p *BeaconDbBlocker) Block(ctx context.Context, id []byte) (interfaces.Read
|
|||||||
}
|
}
|
||||||
return blk, nil
|
return blk, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Blobs returns the blobs for a given block id identifier and blob indices. The identifier can be one of:
|
||||||
|
// - "head" (canonical head in node's view)
|
||||||
|
// - "genesis"
|
||||||
|
// - "finalized"
|
||||||
|
// - "justified"
|
||||||
|
// - <slot>
|
||||||
|
// - <hex encoded block root with '0x' prefix>
|
||||||
|
// - <block root>
|
||||||
|
func (p *BeaconDbBlocker) Blobs(ctx context.Context, id string, indices []uint64) ([]*blocks.VerifiedROBlob, *core.RpcError) {
|
||||||
|
var blobs []*blocks.VerifiedROBlob
|
||||||
|
var root []byte
|
||||||
|
switch id {
|
||||||
|
case "genesis":
|
||||||
|
return nil, &core.RpcError{Err: errors.New("blobs are not supported for Phase 0 fork"), Reason: core.BadRequest}
|
||||||
|
case "head":
|
||||||
|
var err error
|
||||||
|
root, err = p.ChainInfoFetcher.HeadRoot(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, &core.RpcError{Err: errors.Wrapf(err, "could not retrieve head root"), Reason: core.Internal}
|
||||||
|
}
|
||||||
|
case "finalized":
|
||||||
|
fcp := p.ChainInfoFetcher.FinalizedCheckpt()
|
||||||
|
if fcp == nil {
|
||||||
|
return nil, &core.RpcError{Err: errors.New("received nil finalized checkpoint"), Reason: core.Internal}
|
||||||
|
}
|
||||||
|
root = fcp.Root
|
||||||
|
case "justified":
|
||||||
|
jcp := p.ChainInfoFetcher.CurrentJustifiedCheckpt()
|
||||||
|
if jcp == nil {
|
||||||
|
return nil, &core.RpcError{Err: errors.New("received nil justified checkpoint"), Reason: core.Internal}
|
||||||
|
}
|
||||||
|
root = jcp.Root
|
||||||
|
default:
|
||||||
|
if bytesutil.IsHex([]byte(id)) {
|
||||||
|
var err error
|
||||||
|
root, err = hexutil.Decode(id)
|
||||||
|
if len(root) != fieldparams.RootLength {
|
||||||
|
return nil, &core.RpcError{Err: fmt.Errorf("invalid block root of length %d", len(root)), Reason: core.BadRequest}
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return nil, &core.RpcError{Err: NewBlockIdParseError(err), Reason: core.BadRequest}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
slot, err := strconv.ParseUint(id, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
return nil, &core.RpcError{Err: NewBlockIdParseError(err), Reason: core.BadRequest}
|
||||||
|
}
|
||||||
|
denebStart, err := slots.EpochStart(params.BeaconConfig().DenebForkEpoch)
|
||||||
|
if err != nil {
|
||||||
|
return nil, &core.RpcError{Err: errors.Wrap(err, "could not calculate Deneb start slot"), Reason: core.Internal}
|
||||||
|
}
|
||||||
|
if primitives.Slot(slot) < denebStart {
|
||||||
|
return nil, &core.RpcError{Err: errors.New("blobs are not supported before Deneb fork"), Reason: core.BadRequest}
|
||||||
|
}
|
||||||
|
ok, roots, err := p.BeaconDB.BlockRootsBySlot(ctx, primitives.Slot(slot))
|
||||||
|
if !ok {
|
||||||
|
return nil, &core.RpcError{Err: fmt.Errorf("block not found: no block roots at slot %d", slot), Reason: core.NotFound}
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return nil, &core.RpcError{Err: errors.Wrap(err, "failed to get block roots by slot"), Reason: core.Internal}
|
||||||
|
}
|
||||||
|
root = roots[0][:]
|
||||||
|
if len(roots) == 1 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
for _, blockRoot := range roots {
|
||||||
|
canonical, err := p.ChainInfoFetcher.IsCanonical(ctx, blockRoot)
|
||||||
|
if err != nil {
|
||||||
|
return nil, &core.RpcError{Err: errors.Wrap(err, "could not determine if block root is canonical"), Reason: core.Internal}
|
||||||
|
}
|
||||||
|
if canonical {
|
||||||
|
root = blockRoot[:]
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(indices) == 0 {
|
||||||
|
m, err := p.BlobStorage.Indices(bytesutil.ToBytes32(root))
|
||||||
|
if err != nil {
|
||||||
|
return nil, &core.RpcError{Err: errors.Wrapf(err, "could not retrieve blob indices for root %#x", root), Reason: core.Internal}
|
||||||
|
}
|
||||||
|
for k, v := range m {
|
||||||
|
if v {
|
||||||
|
indices = append(indices, uint64(k))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(indices) == 0 {
|
||||||
|
return nil, &core.RpcError{Err: errors.New("no blobs found"), Reason: core.Internal}
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, index := range indices {
|
||||||
|
vblob, err := p.BlobStorage.Get(bytesutil.ToBytes32(root), index)
|
||||||
|
if err != nil {
|
||||||
|
return nil, &core.RpcError{Err: errors.Wrapf(err, "could not retrieve blob for block root %#x at index %d", root, index), Reason: core.Internal}
|
||||||
|
}
|
||||||
|
blobs = append(blobs, &vblob)
|
||||||
|
}
|
||||||
|
return blobs, nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,13 +3,18 @@ package lookup
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
mock "github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain/testing"
|
mockChain "github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain/testing"
|
||||||
dbtesting "github.com/prysmaticlabs/prysm/v4/beacon-chain/db/testing"
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/db/filesystem"
|
||||||
|
testDB "github.com/prysmaticlabs/prysm/v4/beacon-chain/db/testing"
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/core"
|
||||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/testutil"
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/testutil"
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/verification"
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/config/params"
|
||||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/blocks"
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/blocks"
|
||||||
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
|
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
|
||||||
ethpbalpha "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
ethpbalpha "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
||||||
@@ -19,7 +24,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestGetBlock(t *testing.T) {
|
func TestGetBlock(t *testing.T) {
|
||||||
beaconDB := dbtesting.SetupDB(t)
|
beaconDB := testDB.SetupDB(t)
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
genBlk, blkContainers := testutil.FillDBWithBlocks(ctx, t, beaconDB)
|
genBlk, blkContainers := testutil.FillDBWithBlocks(ctx, t, beaconDB)
|
||||||
@@ -49,7 +54,7 @@ func TestGetBlock(t *testing.T) {
|
|||||||
|
|
||||||
fetcher := &BeaconDbBlocker{
|
fetcher := &BeaconDbBlocker{
|
||||||
BeaconDB: beaconDB,
|
BeaconDB: beaconDB,
|
||||||
ChainInfoFetcher: &mock.ChainService{
|
ChainInfoFetcher: &mockChain.ChainService{
|
||||||
DB: beaconDB,
|
DB: beaconDB,
|
||||||
Block: wsb,
|
Block: wsb,
|
||||||
Root: headBlock.BlockRoot,
|
Root: headBlock.BlockRoot,
|
||||||
@@ -148,3 +153,118 @@ func TestGetBlock(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetBlob(t *testing.T) {
|
||||||
|
params.SetupTestConfigCleanup(t)
|
||||||
|
cfg := params.BeaconConfig().Copy()
|
||||||
|
cfg.DenebForkEpoch = 1
|
||||||
|
params.OverrideBeaconConfig(cfg)
|
||||||
|
ctx := context.Background()
|
||||||
|
db := testDB.SetupDB(t)
|
||||||
|
denebBlock, blobs := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, 123, 4)
|
||||||
|
require.NoError(t, db.SaveBlock(context.Background(), denebBlock))
|
||||||
|
_, bs, err := filesystem.NewEphemeralBlobStorageWithFs(t)
|
||||||
|
require.NoError(t, err)
|
||||||
|
testSidecars, err := verification.BlobSidecarSliceNoop(blobs)
|
||||||
|
require.NoError(t, err)
|
||||||
|
for i := range testSidecars {
|
||||||
|
require.NoError(t, bs.Save(testSidecars[i]))
|
||||||
|
}
|
||||||
|
blockRoot := blobs[0].BlockRoot()
|
||||||
|
t.Run("genesis", func(t *testing.T) {
|
||||||
|
blocker := &BeaconDbBlocker{}
|
||||||
|
_, rpcErr := blocker.Blobs(ctx, "genesis", nil)
|
||||||
|
assert.Equal(t, http.StatusBadRequest, core.ErrorReasonToHTTP(rpcErr.Reason))
|
||||||
|
assert.StringContains(t, "blobs are not supported for Phase 0 fork", rpcErr.Err.Error())
|
||||||
|
})
|
||||||
|
t.Run("head", func(t *testing.T) {
|
||||||
|
blocker := &BeaconDbBlocker{
|
||||||
|
ChainInfoFetcher: &mockChain.ChainService{Root: blockRoot[:]},
|
||||||
|
BeaconDB: db,
|
||||||
|
BlobStorage: bs,
|
||||||
|
}
|
||||||
|
verifiedBlobs, rpcErr := blocker.Blobs(ctx, "head", nil)
|
||||||
|
assert.Equal(t, rpcErr == nil, true)
|
||||||
|
require.Equal(t, 4, len(verifiedBlobs))
|
||||||
|
sidecar := verifiedBlobs[0].BlobSidecar
|
||||||
|
require.NotNil(t, sidecar)
|
||||||
|
assert.Equal(t, uint64(0), sidecar.Index)
|
||||||
|
assert.DeepEqual(t, blobs[0].Blob, sidecar.Blob)
|
||||||
|
assert.DeepEqual(t, blobs[0].KzgCommitment, sidecar.KzgCommitment)
|
||||||
|
assert.DeepEqual(t, blobs[0].KzgProof, sidecar.KzgProof)
|
||||||
|
sidecar = verifiedBlobs[1].BlobSidecar
|
||||||
|
require.NotNil(t, sidecar)
|
||||||
|
assert.Equal(t, uint64(1), sidecar.Index)
|
||||||
|
assert.DeepEqual(t, blobs[1].Blob, sidecar.Blob)
|
||||||
|
assert.DeepEqual(t, blobs[1].KzgCommitment, sidecar.KzgCommitment)
|
||||||
|
assert.DeepEqual(t, blobs[1].KzgProof, sidecar.KzgProof)
|
||||||
|
sidecar = verifiedBlobs[2].BlobSidecar
|
||||||
|
require.NotNil(t, sidecar)
|
||||||
|
assert.Equal(t, uint64(2), sidecar.Index)
|
||||||
|
assert.DeepEqual(t, blobs[2].Blob, sidecar.Blob)
|
||||||
|
assert.DeepEqual(t, blobs[2].KzgCommitment, sidecar.KzgCommitment)
|
||||||
|
assert.DeepEqual(t, blobs[2].KzgProof, sidecar.KzgProof)
|
||||||
|
sidecar = verifiedBlobs[3].BlobSidecar
|
||||||
|
require.NotNil(t, sidecar)
|
||||||
|
assert.Equal(t, uint64(3), sidecar.Index)
|
||||||
|
assert.DeepEqual(t, blobs[3].Blob, sidecar.Blob)
|
||||||
|
assert.DeepEqual(t, blobs[3].KzgCommitment, sidecar.KzgCommitment)
|
||||||
|
assert.DeepEqual(t, blobs[3].KzgProof, sidecar.KzgProof)
|
||||||
|
})
|
||||||
|
t.Run("finalized", func(t *testing.T) {
|
||||||
|
blocker := &BeaconDbBlocker{
|
||||||
|
ChainInfoFetcher: &mockChain.ChainService{FinalizedCheckPoint: ðpbalpha.Checkpoint{Root: blockRoot[:]}},
|
||||||
|
BeaconDB: db,
|
||||||
|
BlobStorage: bs,
|
||||||
|
}
|
||||||
|
|
||||||
|
verifiedBlobs, rpcErr := blocker.Blobs(ctx, "finalized", nil)
|
||||||
|
assert.Equal(t, rpcErr == nil, true)
|
||||||
|
require.Equal(t, 4, len(verifiedBlobs))
|
||||||
|
})
|
||||||
|
t.Run("justified", func(t *testing.T) {
|
||||||
|
blocker := &BeaconDbBlocker{
|
||||||
|
ChainInfoFetcher: &mockChain.ChainService{CurrentJustifiedCheckPoint: ðpbalpha.Checkpoint{Root: blockRoot[:]}},
|
||||||
|
BeaconDB: db,
|
||||||
|
BlobStorage: bs,
|
||||||
|
}
|
||||||
|
|
||||||
|
verifiedBlobs, rpcErr := blocker.Blobs(ctx, "justified", nil)
|
||||||
|
assert.Equal(t, rpcErr == nil, true)
|
||||||
|
require.Equal(t, 4, len(verifiedBlobs))
|
||||||
|
})
|
||||||
|
t.Run("root", func(t *testing.T) {
|
||||||
|
blocker := &BeaconDbBlocker{
|
||||||
|
BeaconDB: db,
|
||||||
|
BlobStorage: bs,
|
||||||
|
}
|
||||||
|
verifiedBlobs, rpcErr := blocker.Blobs(ctx, hexutil.Encode(blockRoot[:]), nil)
|
||||||
|
assert.Equal(t, rpcErr == nil, true)
|
||||||
|
require.Equal(t, 4, len(verifiedBlobs))
|
||||||
|
})
|
||||||
|
t.Run("slot", func(t *testing.T) {
|
||||||
|
blocker := &BeaconDbBlocker{
|
||||||
|
BeaconDB: db,
|
||||||
|
BlobStorage: bs,
|
||||||
|
}
|
||||||
|
verifiedBlobs, rpcErr := blocker.Blobs(ctx, "123", nil)
|
||||||
|
assert.Equal(t, rpcErr == nil, true)
|
||||||
|
require.Equal(t, 4, len(verifiedBlobs))
|
||||||
|
})
|
||||||
|
t.Run("one blob only", func(t *testing.T) {
|
||||||
|
blocker := &BeaconDbBlocker{
|
||||||
|
ChainInfoFetcher: &mockChain.ChainService{FinalizedCheckPoint: ðpbalpha.Checkpoint{Root: blockRoot[:]}},
|
||||||
|
BeaconDB: db,
|
||||||
|
BlobStorage: bs,
|
||||||
|
}
|
||||||
|
verifiedBlobs, rpcErr := blocker.Blobs(ctx, "123", []uint64{2})
|
||||||
|
assert.Equal(t, rpcErr == nil, true)
|
||||||
|
require.Equal(t, 1, len(verifiedBlobs))
|
||||||
|
sidecar := verifiedBlobs[0].BlobSidecar
|
||||||
|
require.NotNil(t, sidecar)
|
||||||
|
assert.Equal(t, uint64(2), sidecar.Index)
|
||||||
|
assert.DeepEqual(t, blobs[2].Blob, sidecar.Blob)
|
||||||
|
assert.DeepEqual(t, blobs[2].KzgCommitment, sidecar.KzgCommitment)
|
||||||
|
assert.DeepEqual(t, blobs[2].KzgProof, sidecar.KzgProof)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -41,12 +41,16 @@ func (vs *Server) constructGenericBeaconBlock(sBlk interfaces.SignedBeaconBlock,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Helper functions for constructing blocks for each version
|
// Helper functions for constructing blocks for each version
|
||||||
func (vs *Server) constructDenebBlock(blockProto proto.Message, isBlinded bool, payloadValue uint64, _ *enginev1.BlobsBundle) *ethpb.GenericBeaconBlock {
|
func (vs *Server) constructDenebBlock(blockProto proto.Message, isBlinded bool, payloadValue uint64, bundle *enginev1.BlobsBundle) *ethpb.GenericBeaconBlock {
|
||||||
// TODO update generic beacon block to use block contents instead
|
|
||||||
if isBlinded {
|
if isBlinded {
|
||||||
return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedDeneb{BlindedDeneb: ðpb.BlindedBeaconBlockAndBlobsDeneb{Block: blockProto.(*ethpb.BlindedBeaconBlockDeneb)}}, IsBlinded: true, PayloadValue: payloadValue}
|
return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_BlindedDeneb{BlindedDeneb: blockProto.(*ethpb.BlindedBeaconBlockDeneb)}, IsBlinded: true, PayloadValue: payloadValue}
|
||||||
}
|
}
|
||||||
return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Deneb{Deneb: blockProto.(*ethpb.BeaconBlockDeneb)}, IsBlinded: false, PayloadValue: payloadValue}
|
denebContents := ðpb.BeaconBlockContentsDeneb{Block: blockProto.(*ethpb.BeaconBlockDeneb)}
|
||||||
|
if bundle != nil {
|
||||||
|
denebContents.KzgProofs = bundle.Proofs
|
||||||
|
denebContents.Blobs = bundle.Blobs
|
||||||
|
}
|
||||||
|
return ðpb.GenericBeaconBlock{Block: ðpb.GenericBeaconBlock_Deneb{Deneb: denebContents}, IsBlinded: false, PayloadValue: payloadValue}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (vs *Server) constructCapellaBlock(pb proto.Message, isBlinded bool, payloadValue uint64) *ethpb.GenericBeaconBlock {
|
func (vs *Server) constructCapellaBlock(pb proto.Message, isBlinded bool, payloadValue uint64) *ethpb.GenericBeaconBlock {
|
||||||
|
|||||||
@@ -3,8 +3,11 @@ package validator
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
|
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
|
||||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/blocks"
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/blocks"
|
||||||
enginev1 "github.com/prysmaticlabs/prysm/v4/proto/engine/v1"
|
enginev1 "github.com/prysmaticlabs/prysm/v4/proto/engine/v1"
|
||||||
|
eth "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
||||||
"github.com/prysmaticlabs/prysm/v4/testing/require"
|
"github.com/prysmaticlabs/prysm/v4/testing/require"
|
||||||
"github.com/prysmaticlabs/prysm/v4/testing/util"
|
"github.com/prysmaticlabs/prysm/v4/testing/util"
|
||||||
)
|
)
|
||||||
@@ -23,9 +26,26 @@ func TestConstructGenericBeaconBlock(t *testing.T) {
|
|||||||
eb := util.NewBeaconBlockDeneb()
|
eb := util.NewBeaconBlockDeneb()
|
||||||
b, err := blocks.NewSignedBeaconBlock(eb)
|
b, err := blocks.NewSignedBeaconBlock(eb)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
r1, err := b.Block().HashTreeRoot()
|
commitment, err := hexutil.Decode("0x8dab030c51e16e84be9caab84ee3d0b8bbec1db4a0e4de76439da8424d9b957370a10a78851f97e4b54d2ce1ab0d686f")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
result, err := vs.constructGenericBeaconBlock(b, nil)
|
proof, err := hexutil.Decode("0xb4021b0de10f743893d4f71e1bf830c019e832958efd6795baf2f83b8699a9eccc5dc99015d8d4d8ec370d0cc333c06a")
|
||||||
|
require.NoError(t, err)
|
||||||
|
bundle := &enginev1.BlobsBundle{
|
||||||
|
KzgCommitments: [][]byte{
|
||||||
|
commitment,
|
||||||
|
},
|
||||||
|
Proofs: [][]byte{
|
||||||
|
proof,
|
||||||
|
},
|
||||||
|
Blobs: [][]byte{
|
||||||
|
make([]byte, fieldparams.BlobLength),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
contents := ð.BeaconBlockContentsDeneb{Block: eb.Block, KzgProofs: bundle.Proofs, Blobs: bundle.Blobs}
|
||||||
|
r1, err := contents.HashTreeRoot()
|
||||||
|
require.NoError(t, err)
|
||||||
|
result, err := vs.constructGenericBeaconBlock(b, bundle)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
r2, err := result.GetDeneb().HashTreeRoot()
|
r2, err := result.GetDeneb().HashTreeRoot()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
@@ -42,7 +62,7 @@ func TestConstructGenericBeaconBlock(t *testing.T) {
|
|||||||
scs := &enginev1.BlobsBundle{}
|
scs := &enginev1.BlobsBundle{}
|
||||||
result, err := vs.constructGenericBeaconBlock(b, scs)
|
result, err := vs.constructGenericBeaconBlock(b, scs)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
r2, err := result.GetBlindedDeneb().Block.HashTreeRoot()
|
r2, err := result.GetBlindedDeneb().HashTreeRoot()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, r1, r2)
|
require.Equal(t, r1, r2)
|
||||||
// TODO: update with kzg commit check after updating generic beacon block
|
// TODO: update with kzg commit check after updating generic beacon block
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ func (vs *Server) GetBeaconBlock(ctx context.Context, req *ethpb.BlockRequest) (
|
|||||||
"validator": sBlk.Block().ProposerIndex(),
|
"validator": sBlk.Block().ProposerIndex(),
|
||||||
}).Info("Finished building block")
|
}).Info("Finished building block")
|
||||||
|
|
||||||
|
// Blob cache is updated after BuildBlockParallel
|
||||||
return vs.constructGenericBeaconBlock(sBlk, bundleCache.get(req.Slot))
|
return vs.constructGenericBeaconBlock(sBlk, bundleCache.get(req.Slot))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,7 +233,11 @@ func (vs *Server) ProposeBeaconBlock(ctx context.Context, req *ethpb.GenericSign
|
|||||||
|
|
||||||
if blk.Version() >= version.Deneb {
|
if blk.Version() >= version.Deneb {
|
||||||
if !blinded {
|
if !blinded {
|
||||||
scs, err = buildBlobSidecars(blk)
|
dbBlockContents := req.GetDeneb()
|
||||||
|
if dbBlockContents == nil {
|
||||||
|
return nil, errors.New("signed beacon block contents is empty")
|
||||||
|
}
|
||||||
|
scs, err = buildBlobSidecars(blk, dbBlockContents.Blobs, dbBlockContents.KzgProofs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("could not build blob sidecars: %v", err)
|
return nil, fmt.Errorf("could not build blob sidecars: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package validator
|
package validator
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/blocks"
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/blocks"
|
||||||
@@ -56,15 +57,19 @@ func (c *blobsBundleCache) prune(minSlot primitives.Slot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// buildBlobSidecars given a block, builds the blob sidecars for the block.
|
// buildBlobSidecars given a block, builds the blob sidecars for the block.
|
||||||
func buildBlobSidecars(blk interfaces.SignedBeaconBlock) ([]*ethpb.BlobSidecar, error) {
|
func buildBlobSidecars(blk interfaces.SignedBeaconBlock, blobs [][]byte, kzgproofs [][]byte) ([]*ethpb.BlobSidecar, error) {
|
||||||
if blk.Version() < version.Deneb {
|
if blk.Version() < version.Deneb {
|
||||||
return nil, nil // No blobs before deneb.
|
return nil, nil // No blobs before deneb.
|
||||||
}
|
}
|
||||||
bundle := bundleCache.get(blk.Block().Slot())
|
denebBlk, err := blk.PbDenebBlock()
|
||||||
if bundle == nil {
|
if err != nil {
|
||||||
return nil, nil
|
return nil, err
|
||||||
}
|
}
|
||||||
blobSidecars := make([]*ethpb.BlobSidecar, len(bundle.KzgCommitments))
|
cLen := len(denebBlk.Block.Body.BlobKzgCommitments)
|
||||||
|
if cLen != len(blobs) || cLen != len(kzgproofs) {
|
||||||
|
return nil, errors.New("blob KZG commitments don't match number of blobs or KZG proofs")
|
||||||
|
}
|
||||||
|
blobSidecars := make([]*ethpb.BlobSidecar, cLen)
|
||||||
header, err := blk.Header()
|
header, err := blk.Header()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -77,9 +82,9 @@ func buildBlobSidecars(blk interfaces.SignedBeaconBlock) ([]*ethpb.BlobSidecar,
|
|||||||
}
|
}
|
||||||
blobSidecars[i] = ðpb.BlobSidecar{
|
blobSidecars[i] = ðpb.BlobSidecar{
|
||||||
Index: uint64(i),
|
Index: uint64(i),
|
||||||
Blob: bundle.Blobs[i],
|
Blob: blobs[i],
|
||||||
KzgCommitment: bundle.KzgCommitments[i],
|
KzgCommitment: denebBlk.Block.Body.BlobKzgCommitments[i],
|
||||||
KzgProof: bundle.Proofs[i],
|
KzgProof: kzgproofs[i],
|
||||||
SignedBlockHeader: header,
|
SignedBlockHeader: header,
|
||||||
CommitmentInclusionProof: proof,
|
CommitmentInclusionProof: proof,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package validator
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
|
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
|
||||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/blocks"
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/blocks"
|
||||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
||||||
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
|
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
|
||||||
@@ -44,16 +46,16 @@ func TestPrune(t *testing.T) {
|
|||||||
|
|
||||||
func TestServer_buildBlobSidecars(t *testing.T) {
|
func TestServer_buildBlobSidecars(t *testing.T) {
|
||||||
kzgCommitments := [][]byte{bytesutil.PadTo([]byte{'a'}, 48), bytesutil.PadTo([]byte{'b'}, 48)}
|
kzgCommitments := [][]byte{bytesutil.PadTo([]byte{'a'}, 48), bytesutil.PadTo([]byte{'b'}, 48)}
|
||||||
bundle := &enginev1.BlobsBundle{
|
|
||||||
KzgCommitments: kzgCommitments,
|
|
||||||
Proofs: [][]byte{{0x03}, {0x04}},
|
|
||||||
Blobs: [][]byte{{0x05}, {0x06}},
|
|
||||||
}
|
|
||||||
bundleCache.add(0, bundle)
|
|
||||||
blk, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockDeneb())
|
blk, err := blocks.NewSignedBeaconBlock(util.NewBeaconBlockDeneb())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NoError(t, blk.SetBlobKzgCommitments(kzgCommitments))
|
require.NoError(t, blk.SetBlobKzgCommitments(kzgCommitments))
|
||||||
scs, err := buildBlobSidecars(blk)
|
proof, err := hexutil.Decode("0xb4021b0de10f743893d4f71e1bf830c019e832958efd6795baf2f83b8699a9eccc5dc99015d8d4d8ec370d0cc333c06a")
|
||||||
|
require.NoError(t, err)
|
||||||
|
scs, err := buildBlobSidecars(blk, [][]byte{
|
||||||
|
make([]byte, fieldparams.BlobLength), make([]byte, fieldparams.BlobLength),
|
||||||
|
}, [][]byte{
|
||||||
|
proof, proof,
|
||||||
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, 2, len(scs))
|
require.Equal(t, 2, len(scs))
|
||||||
|
|
||||||
|
|||||||
@@ -547,7 +547,7 @@ func TestServer_GetBeaconBlock_Deneb(t *testing.T) {
|
|||||||
|
|
||||||
got, err := proposerServer.GetBeaconBlock(ctx, req)
|
got, err := proposerServer.GetBeaconBlock(ctx, req)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.DeepEqual(t, got.GetDeneb().Body.BlobKzgCommitments, kc)
|
require.DeepEqual(t, got.GetDeneb().Block.Body.BlobKzgCommitments, kc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestServer_GetBeaconBlock_Optimistic(t *testing.T) {
|
func TestServer_GetBeaconBlock_Optimistic(t *testing.T) {
|
||||||
@@ -692,14 +692,13 @@ func TestProposer_ProposeBlock_OK(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "deneb block no blob",
|
name: "deneb block no blob",
|
||||||
block: func(parent [32]byte) *ethpb.GenericSignedBeaconBlock {
|
block: func(parent [32]byte) *ethpb.GenericSignedBeaconBlock {
|
||||||
blockToPropose := util.NewBeaconBlockDeneb()
|
blockToPropose := util.NewBeaconBlockContentsDeneb()
|
||||||
blockToPropose.Block.Slot = 5
|
blockToPropose.Block.Block.Slot = 5
|
||||||
blockToPropose.Block.ParentRoot = parent[:]
|
blockToPropose.Block.Block.ParentRoot = parent[:]
|
||||||
blk := ðpb.GenericSignedBeaconBlock_Deneb{Deneb: blockToPropose}
|
blk := ðpb.GenericSignedBeaconBlock_Deneb{Deneb: blockToPropose}
|
||||||
return ðpb.GenericSignedBeaconBlock{Block: blk}
|
return ðpb.GenericSignedBeaconBlock{Block: blk}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
//TODO: add deneb blocks
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import (
|
|||||||
grpcopentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
|
grpcopentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
|
||||||
grpcprometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
grpcprometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/db/filesystem"
|
||||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/config"
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/config"
|
||||||
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/events"
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/events"
|
||||||
beaconprysm "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/prysm/beacon"
|
beaconprysm "github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/prysm/beacon"
|
||||||
@@ -132,6 +133,7 @@ type Config struct {
|
|||||||
BlockBuilder builder.BlockBuilder
|
BlockBuilder builder.BlockBuilder
|
||||||
Router *mux.Router
|
Router *mux.Router
|
||||||
ClockWaiter startup.ClockWaiter
|
ClockWaiter startup.ClockWaiter
|
||||||
|
BlobStorage *filesystem.BlobStorage
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewService instantiates a new RPC service instance that will
|
// NewService instantiates a new RPC service instance that will
|
||||||
@@ -333,6 +335,7 @@ func (s *Service) Start() {
|
|||||||
blocker := &lookup.BeaconDbBlocker{
|
blocker := &lookup.BeaconDbBlocker{
|
||||||
BeaconDB: s.cfg.BeaconDB,
|
BeaconDB: s.cfg.BeaconDB,
|
||||||
ChainInfoFetcher: s.cfg.ChainInfoFetcher,
|
ChainInfoFetcher: s.cfg.ChainInfoFetcher,
|
||||||
|
BlobStorage: s.cfg.BlobStorage,
|
||||||
}
|
}
|
||||||
rewardFetcher := &rewards.BlockRewardService{Replayer: ch}
|
rewardFetcher := &rewards.BlockRewardService{Replayer: ch}
|
||||||
|
|
||||||
@@ -351,8 +354,7 @@ func (s *Service) Start() {
|
|||||||
Stater: stater,
|
Stater: stater,
|
||||||
})
|
})
|
||||||
s.initializeBlobServerRoutes(&blob.Server{
|
s.initializeBlobServerRoutes(&blob.Server{
|
||||||
ChainInfoFetcher: s.cfg.ChainInfoFetcher,
|
Blocker: blocker,
|
||||||
BeaconDB: s.cfg.BeaconDB,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
coreService := &core.Service{
|
coreService := &core.Service{
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ go_library(
|
|||||||
visibility = ["//beacon-chain:__subpackages__"],
|
visibility = ["//beacon-chain:__subpackages__"],
|
||||||
deps = [
|
deps = [
|
||||||
"//beacon-chain/db:go_default_library",
|
"//beacon-chain/db:go_default_library",
|
||||||
|
"//beacon-chain/rpc/core:go_default_library",
|
||||||
"//beacon-chain/state:go_default_library",
|
"//beacon-chain/state:go_default_library",
|
||||||
"//config/params:go_default_library",
|
"//config/params:go_default_library",
|
||||||
"//consensus-types/blocks:go_default_library",
|
"//consensus-types/blocks:go_default_library",
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/core"
|
||||||
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/blocks"
|
||||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/interfaces"
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/interfaces"
|
||||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
||||||
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
|
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
|
||||||
@@ -32,3 +34,8 @@ func (m *MockBlocker) Block(_ context.Context, b []byte) (interfaces.ReadOnlySig
|
|||||||
}
|
}
|
||||||
return m.SlotBlockMap[primitives.Slot(slotNumber)], nil
|
return m.SlotBlockMap[primitives.Slot(slotNumber)], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Blobs --
|
||||||
|
func (m *MockBlocker) Blobs(_ context.Context, _ string, _ []uint64) ([]*blocks.VerifiedROBlob, *core.RpcError) {
|
||||||
|
panic("implement me")
|
||||||
|
}
|
||||||
|
|||||||
@@ -57,13 +57,13 @@ func NewSignedBeaconBlock(i interface{}) (interfaces.SignedBeaconBlock, error) {
|
|||||||
case *eth.SignedBlindedBeaconBlockCapella:
|
case *eth.SignedBlindedBeaconBlockCapella:
|
||||||
return initBlindedSignedBlockFromProtoCapella(b)
|
return initBlindedSignedBlockFromProtoCapella(b)
|
||||||
case *eth.GenericSignedBeaconBlock_Deneb:
|
case *eth.GenericSignedBeaconBlock_Deneb:
|
||||||
return initSignedBlockFromProtoDeneb(b.Deneb)
|
return initSignedBlockFromProtoDeneb(b.Deneb.Block)
|
||||||
case *eth.SignedBeaconBlockDeneb:
|
case *eth.SignedBeaconBlockDeneb:
|
||||||
return initSignedBlockFromProtoDeneb(b)
|
return initSignedBlockFromProtoDeneb(b)
|
||||||
case *eth.SignedBlindedBeaconBlockDeneb:
|
case *eth.SignedBlindedBeaconBlockDeneb:
|
||||||
return initBlindedSignedBlockFromProtoDeneb(b)
|
return initBlindedSignedBlockFromProtoDeneb(b)
|
||||||
case *eth.GenericSignedBeaconBlock_BlindedDeneb:
|
case *eth.GenericSignedBeaconBlock_BlindedDeneb:
|
||||||
return initBlindedSignedBlockFromProtoDeneb(b.BlindedDeneb.SignedBlindedBlock)
|
return initBlindedSignedBlockFromProtoDeneb(b.BlindedDeneb)
|
||||||
default:
|
default:
|
||||||
return nil, errors.Wrapf(ErrUnsupportedSignedBeaconBlock, "unable to create block from type %T", i)
|
return nil, errors.Wrapf(ErrUnsupportedSignedBeaconBlock, "unable to create block from type %T", i)
|
||||||
}
|
}
|
||||||
@@ -99,13 +99,13 @@ func NewBeaconBlock(i interface{}) (interfaces.ReadOnlyBeaconBlock, error) {
|
|||||||
case *eth.BlindedBeaconBlockCapella:
|
case *eth.BlindedBeaconBlockCapella:
|
||||||
return initBlindedBlockFromProtoCapella(b)
|
return initBlindedBlockFromProtoCapella(b)
|
||||||
case *eth.GenericBeaconBlock_Deneb:
|
case *eth.GenericBeaconBlock_Deneb:
|
||||||
return initBlockFromProtoDeneb(b.Deneb)
|
return initBlockFromProtoDeneb(b.Deneb.Block)
|
||||||
case *eth.BeaconBlockDeneb:
|
case *eth.BeaconBlockDeneb:
|
||||||
return initBlockFromProtoDeneb(b)
|
return initBlockFromProtoDeneb(b)
|
||||||
case *eth.BlindedBeaconBlockDeneb:
|
case *eth.BlindedBeaconBlockDeneb:
|
||||||
return initBlindedBlockFromProtoDeneb(b)
|
return initBlindedBlockFromProtoDeneb(b)
|
||||||
case *eth.GenericBeaconBlock_BlindedDeneb:
|
case *eth.GenericBeaconBlock_BlindedDeneb:
|
||||||
return initBlindedBlockFromProtoDeneb(b.BlindedDeneb.Block)
|
return initBlindedBlockFromProtoDeneb(b.BlindedDeneb)
|
||||||
default:
|
default:
|
||||||
return nil, errors.Wrapf(errUnsupportedBeaconBlock, "unable to create block from type %T", i)
|
return nil, errors.Wrapf(errUnsupportedBeaconBlock, "unable to create block from type %T", i)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,10 +123,12 @@ func Test_NewSignedBeaconBlock(t *testing.T) {
|
|||||||
})
|
})
|
||||||
t.Run("GenericSignedBeaconBlock_Deneb", func(t *testing.T) {
|
t.Run("GenericSignedBeaconBlock_Deneb", func(t *testing.T) {
|
||||||
pb := ð.GenericSignedBeaconBlock_Deneb{
|
pb := ð.GenericSignedBeaconBlock_Deneb{
|
||||||
Deneb: ð.SignedBeaconBlockDeneb{
|
Deneb: ð.SignedBeaconBlockContentsDeneb{
|
||||||
Block: ð.BeaconBlockDeneb{
|
Block: ð.SignedBeaconBlockDeneb{Block: ð.BeaconBlockDeneb{
|
||||||
Body: ð.BeaconBlockBodyDeneb{},
|
Body: ð.BeaconBlockBodyDeneb{},
|
||||||
}}}
|
}},
|
||||||
|
},
|
||||||
|
}
|
||||||
b, err := NewSignedBeaconBlock(pb)
|
b, err := NewSignedBeaconBlock(pb)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, version.Deneb, b.Version())
|
assert.Equal(t, version.Deneb, b.Version())
|
||||||
@@ -150,11 +152,10 @@ func Test_NewSignedBeaconBlock(t *testing.T) {
|
|||||||
})
|
})
|
||||||
t.Run("GenericSignedBeaconBlock_BlindedDeneb", func(t *testing.T) {
|
t.Run("GenericSignedBeaconBlock_BlindedDeneb", func(t *testing.T) {
|
||||||
pb := ð.GenericSignedBeaconBlock_BlindedDeneb{
|
pb := ð.GenericSignedBeaconBlock_BlindedDeneb{
|
||||||
BlindedDeneb: ð.SignedBlindedBeaconBlockAndBlobsDeneb{
|
BlindedDeneb: ð.SignedBlindedBeaconBlockDeneb{
|
||||||
SignedBlindedBlock: ð.SignedBlindedBeaconBlockDeneb{
|
Message: ð.BlindedBeaconBlockDeneb{
|
||||||
Message: ð.BlindedBeaconBlockDeneb{
|
Body: ð.BlindedBeaconBlockBodyDeneb{},
|
||||||
Body: ð.BlindedBeaconBlockBodyDeneb{},
|
}}}
|
||||||
}}}}
|
|
||||||
b, err := NewSignedBeaconBlock(pb)
|
b, err := NewSignedBeaconBlock(pb)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, version.Deneb, b.Version())
|
assert.Equal(t, version.Deneb, b.Version())
|
||||||
@@ -248,9 +249,9 @@ func Test_NewBeaconBlock(t *testing.T) {
|
|||||||
assert.Equal(t, true, b.IsBlinded())
|
assert.Equal(t, true, b.IsBlinded())
|
||||||
})
|
})
|
||||||
t.Run("GenericBeaconBlock_Deneb", func(t *testing.T) {
|
t.Run("GenericBeaconBlock_Deneb", func(t *testing.T) {
|
||||||
pb := ð.GenericBeaconBlock_Deneb{Deneb: ð.BeaconBlockDeneb{
|
pb := ð.GenericBeaconBlock_Deneb{Deneb: ð.BeaconBlockContentsDeneb{Block: ð.BeaconBlockDeneb{
|
||||||
Body: ð.BeaconBlockBodyDeneb{},
|
Body: ð.BeaconBlockBodyDeneb{},
|
||||||
}}
|
}}}
|
||||||
b, err := NewBeaconBlock(pb)
|
b, err := NewBeaconBlock(pb)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, version.Deneb, b.Version())
|
assert.Equal(t, version.Deneb, b.Version())
|
||||||
@@ -269,7 +270,7 @@ func Test_NewBeaconBlock(t *testing.T) {
|
|||||||
assert.Equal(t, true, b.IsBlinded())
|
assert.Equal(t, true, b.IsBlinded())
|
||||||
})
|
})
|
||||||
t.Run("GenericBeaconBlock_BlindedDeneb", func(t *testing.T) {
|
t.Run("GenericBeaconBlock_BlindedDeneb", func(t *testing.T) {
|
||||||
pb := ð.GenericBeaconBlock_BlindedDeneb{BlindedDeneb: ð.BlindedBeaconBlockAndBlobsDeneb{Block: ð.BlindedBeaconBlockDeneb{Body: ð.BlindedBeaconBlockBodyDeneb{}}}}
|
pb := ð.GenericBeaconBlock_BlindedDeneb{BlindedDeneb: ð.BlindedBeaconBlockDeneb{Body: ð.BlindedBeaconBlockBodyDeneb{}}}
|
||||||
b, err := NewBeaconBlock(pb)
|
b, err := NewBeaconBlock(pb)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, version.Deneb, b.Version())
|
assert.Equal(t, version.Deneb, b.Version())
|
||||||
|
|||||||
@@ -120,13 +120,11 @@ func (b *SignedBeaconBlock) PbGenericBlock() (*eth.GenericSignedBeaconBlock, err
|
|||||||
case version.Deneb:
|
case version.Deneb:
|
||||||
if b.IsBlinded() {
|
if b.IsBlinded() {
|
||||||
return ð.GenericSignedBeaconBlock{
|
return ð.GenericSignedBeaconBlock{
|
||||||
Block: ð.GenericSignedBeaconBlock_BlindedDeneb{BlindedDeneb: ð.SignedBlindedBeaconBlockAndBlobsDeneb{
|
Block: ð.GenericSignedBeaconBlock_BlindedDeneb{BlindedDeneb: pb.(*eth.SignedBlindedBeaconBlockDeneb)},
|
||||||
SignedBlindedBlock: pb.(*eth.SignedBlindedBeaconBlockDeneb),
|
|
||||||
}},
|
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
return ð.GenericSignedBeaconBlock{
|
return ð.GenericSignedBeaconBlock{
|
||||||
Block: ð.GenericSignedBeaconBlock_Deneb{Deneb: pb.(*eth.SignedBeaconBlockDeneb)},
|
Block: ð.GenericSignedBeaconBlock_Deneb{Deneb: pb.(*eth.SignedBeaconBlockContentsDeneb)},
|
||||||
}, nil
|
}, nil
|
||||||
default:
|
default:
|
||||||
return nil, errIncorrectBlockVersion
|
return nil, errIncorrectBlockVersion
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ func NewSignedBeaconBlockFromGeneric(gb *eth.GenericSignedBeaconBlock) (interfac
|
|||||||
case *eth.GenericSignedBeaconBlock_BlindedCapella:
|
case *eth.GenericSignedBeaconBlock_BlindedCapella:
|
||||||
return blocks.NewSignedBeaconBlock(bb.BlindedCapella)
|
return blocks.NewSignedBeaconBlock(bb.BlindedCapella)
|
||||||
case *eth.GenericSignedBeaconBlock_Deneb:
|
case *eth.GenericSignedBeaconBlock_Deneb:
|
||||||
return blocks.NewSignedBeaconBlock(bb.Deneb)
|
return blocks.NewSignedBeaconBlock(bb.Deneb.Block)
|
||||||
case *eth.GenericSignedBeaconBlock_BlindedDeneb:
|
case *eth.GenericSignedBeaconBlock_BlindedDeneb:
|
||||||
return blocks.NewSignedBeaconBlock(bb.BlindedDeneb.SignedBlindedBlock)
|
return blocks.NewSignedBeaconBlock(bb.BlindedDeneb)
|
||||||
// Generic Signed Beacon Block Deneb can't be used here as it is not a block, but block content with blobs
|
// Generic Signed Beacon Block Deneb can't be used here as it is not a block, but block content with blobs
|
||||||
default:
|
default:
|
||||||
return nil, errors.Wrapf(blocks.ErrUnsupportedSignedBeaconBlock, "unable to create block from type %T", gb)
|
return nil, errors.Wrapf(blocks.ErrUnsupportedSignedBeaconBlock, "unable to create block from type %T", gb)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// Code generated by fastssz. DO NOT EDIT.
|
// Code generated by fastssz. DO NOT EDIT.
|
||||||
// Hash: 358c2c838bdfb1f5865e2bae55ce4b1e3a2d45bd1126af782e26d3a9faa4f5e9
|
// Hash: 1405b9393e072e629d421bf89011848cdbc3aeca3fbf89c763bfe1babbf330f5
|
||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -47,15 +47,10 @@ ssz_gen_marshal(
|
|||||||
"SignedBlindedBeaconBlockDeneb",
|
"SignedBlindedBeaconBlockDeneb",
|
||||||
"BlsToExecutionChange",
|
"BlsToExecutionChange",
|
||||||
"SignedBlsToExecutionChange",
|
"SignedBlsToExecutionChange",
|
||||||
"SignedBlindedBlobSidecar",
|
|
||||||
"BlindedBlobSidecar",
|
|
||||||
"BlobSidecar",
|
|
||||||
"BlobSidecars",
|
|
||||||
"SignedBeaconBlockContentsDeneb",
|
"SignedBeaconBlockContentsDeneb",
|
||||||
"SignedBlindedBeaconBlockContentsDeneb",
|
|
||||||
"BeaconBlockContentsDeneb",
|
"BeaconBlockContentsDeneb",
|
||||||
"BlindedBeaconBlockContentsDeneb",
|
|
||||||
"SyncCommittee",
|
"SyncCommittee",
|
||||||
|
"BlobIdentifier",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -105,7 +100,6 @@ ssz_proto_files(
|
|||||||
"beacon_block.proto",
|
"beacon_block.proto",
|
||||||
"beacon_lightclient.proto",
|
"beacon_lightclient.proto",
|
||||||
"beacon_state.proto",
|
"beacon_state.proto",
|
||||||
"blobs.proto",
|
|
||||||
"sync_committee.proto",
|
"sync_committee.proto",
|
||||||
"validator.proto",
|
"validator.proto",
|
||||||
"withdrawals.proto",
|
"withdrawals.proto",
|
||||||
|
|||||||
1653
proto/eth/v2/beacon_block.pb.go
generated
1653
proto/eth/v2/beacon_block.pb.go
generated
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,6 @@ package ethereum.eth.v2;
|
|||||||
import "proto/eth/ext/options.proto";
|
import "proto/eth/ext/options.proto";
|
||||||
import "proto/eth/v1/attestation.proto";
|
import "proto/eth/v1/attestation.proto";
|
||||||
import "proto/eth/v1/beacon_block.proto";
|
import "proto/eth/v1/beacon_block.proto";
|
||||||
import "proto/eth/v2/blobs.proto";
|
|
||||||
import "proto/eth/v2/withdrawals.proto";
|
import "proto/eth/v2/withdrawals.proto";
|
||||||
import "proto/engine/v1/execution_engine.proto";
|
import "proto/engine/v1/execution_engine.proto";
|
||||||
|
|
||||||
@@ -69,7 +68,7 @@ message BlindedBeaconBlockContainer {
|
|||||||
BeaconBlockAltair altair_block = 2;
|
BeaconBlockAltair altair_block = 2;
|
||||||
BlindedBeaconBlockBellatrix bellatrix_block = 3;
|
BlindedBeaconBlockBellatrix bellatrix_block = 3;
|
||||||
BlindedBeaconBlockCapella capella_block = 4;
|
BlindedBeaconBlockCapella capella_block = 4;
|
||||||
BlindedBeaconBlockDeneb deneb_block = 5; // is contents
|
BlindedBeaconBlockDeneb deneb_block = 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +79,7 @@ message SignedBlindedBeaconBlockContainer {
|
|||||||
BeaconBlockAltair altair_block = 2;
|
BeaconBlockAltair altair_block = 2;
|
||||||
BlindedBeaconBlockBellatrix bellatrix_block = 3;
|
BlindedBeaconBlockBellatrix bellatrix_block = 3;
|
||||||
BlindedBeaconBlockCapella capella_block = 4;
|
BlindedBeaconBlockCapella capella_block = 4;
|
||||||
BlindedBeaconBlockDeneb deneb_block = 5; // is block
|
BlindedBeaconBlockDeneb deneb_block = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 96 byte BLS signature from the validator that produced this block.
|
// 96 byte BLS signature from the validator that produced this block.
|
||||||
@@ -530,10 +529,17 @@ message BeaconBlockBodyDeneb {
|
|||||||
|
|
||||||
message SignedBeaconBlockContentsDeneb {
|
message SignedBeaconBlockContentsDeneb {
|
||||||
SignedBeaconBlockDeneb signed_block = 1;
|
SignedBeaconBlockDeneb signed_block = 1;
|
||||||
repeated SignedBlobSidecar signed_blob_sidecars = 2 [(ethereum.eth.ext.ssz_max) = "max_blobs_per_block.size"];
|
repeated bytes kzg_proofs = 2 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "4096"];
|
||||||
|
repeated bytes blobs = 3 [(ethereum.eth.ext.ssz_size) = "?,blob.size", (ethereum.eth.ext.ssz_max) = "4096"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message BeaconBlockContentsDeneb {
|
message BeaconBlockContentsDeneb {
|
||||||
BeaconBlockDeneb block = 1;
|
BeaconBlockDeneb block = 1;
|
||||||
repeated BlobSidecar blob_sidecars = 2 [(ethereum.eth.ext.ssz_max) = "max_blobs_per_block.size"];
|
repeated bytes kzg_proofs = 2 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "4096"];
|
||||||
|
repeated bytes blobs = 3 [(ethereum.eth.ext.ssz_size) = "?,blob.size", (ethereum.eth.ext.ssz_max) = "4096"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message BlobIdentifier {
|
||||||
|
bytes block_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||||
|
uint64 index = 2;
|
||||||
|
}
|
||||||
231
proto/eth/v2/beacon_lightclient.pb.go
generated
231
proto/eth/v2/beacon_lightclient.pb.go
generated
@@ -31,7 +31,7 @@ type LightClientBootstrap struct {
|
|||||||
|
|
||||||
Header *v1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
|
Header *v1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
|
||||||
CurrentSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=current_sync_committee,json=currentSyncCommittee,proto3" json:"current_sync_committee,omitempty"`
|
CurrentSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=current_sync_committee,json=currentSyncCommittee,proto3" json:"current_sync_committee,omitempty"`
|
||||||
CurrentSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=current_sync_committee_branch,json=currentSyncCommitteeBranch,proto3" json:"current_sync_committee_branch,omitempty" ssz-size:"current_sync_committee_branch.depth,32"`
|
CurrentSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=current_sync_committee_branch,json=currentSyncCommitteeBranch,proto3" json:"current_sync_committee_branch,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *LightClientBootstrap) Reset() {
|
func (x *LightClientBootstrap) Reset() {
|
||||||
@@ -94,9 +94,9 @@ type LightClientUpdate struct {
|
|||||||
|
|
||||||
AttestedHeader *v1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"`
|
AttestedHeader *v1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"`
|
||||||
NextSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=next_sync_committee,json=nextSyncCommittee,proto3" json:"next_sync_committee,omitempty"`
|
NextSyncCommittee *SyncCommittee `protobuf:"bytes,2,opt,name=next_sync_committee,json=nextSyncCommittee,proto3" json:"next_sync_committee,omitempty"`
|
||||||
NextSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=next_sync_committee_branch,json=nextSyncCommitteeBranch,proto3" json:"next_sync_committee_branch,omitempty" ssz-size:"next_sync_committee_branch.depth,32"`
|
NextSyncCommitteeBranch [][]byte `protobuf:"bytes,3,rep,name=next_sync_committee_branch,json=nextSyncCommitteeBranch,proto3" json:"next_sync_committee_branch,omitempty"`
|
||||||
FinalizedHeader *v1.BeaconBlockHeader `protobuf:"bytes,4,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"`
|
FinalizedHeader *v1.BeaconBlockHeader `protobuf:"bytes,4,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"`
|
||||||
FinalityBranch [][]byte `protobuf:"bytes,5,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty" ssz-size:"finality_branch.depth,32"`
|
FinalityBranch [][]byte `protobuf:"bytes,5,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty"`
|
||||||
SyncAggregate *v1.SyncAggregate `protobuf:"bytes,6,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"`
|
SyncAggregate *v1.SyncAggregate `protobuf:"bytes,6,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"`
|
||||||
SignatureSlot github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot `protobuf:"varint,7,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"`
|
SignatureSlot github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot `protobuf:"varint,7,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"`
|
||||||
}
|
}
|
||||||
@@ -244,7 +244,7 @@ type LightClientFinalityUpdate struct {
|
|||||||
|
|
||||||
AttestedHeader *v1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"`
|
AttestedHeader *v1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=attested_header,json=attestedHeader,proto3" json:"attested_header,omitempty"`
|
||||||
FinalizedHeader *v1.BeaconBlockHeader `protobuf:"bytes,2,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"`
|
FinalizedHeader *v1.BeaconBlockHeader `protobuf:"bytes,2,opt,name=finalized_header,json=finalizedHeader,proto3" json:"finalized_header,omitempty"`
|
||||||
FinalityBranch [][]byte `protobuf:"bytes,3,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty" ssz-size:"finality_branch.depth,32"`
|
FinalityBranch [][]byte `protobuf:"bytes,3,rep,name=finality_branch,json=finalityBranch,proto3" json:"finality_branch,omitempty"`
|
||||||
SyncAggregate *v1.SyncAggregate `protobuf:"bytes,4,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"`
|
SyncAggregate *v1.SyncAggregate `protobuf:"bytes,4,opt,name=sync_aggregate,json=syncAggregate,proto3" json:"sync_aggregate,omitempty"`
|
||||||
SignatureSlot github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot `protobuf:"varint,5,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"`
|
SignatureSlot github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot `protobuf:"varint,5,opt,name=signature_slot,json=signatureSlot,proto3" json:"signature_slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"`
|
||||||
}
|
}
|
||||||
@@ -450,7 +450,7 @@ var file_proto_eth_v2_beacon_lightclient_proto_rawDesc = []byte{
|
|||||||
0x68, 0x2f, 0x76, 0x32, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f,
|
0x68, 0x2f, 0x76, 0x32, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x74, 0x6f, 0x1a, 0x21, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32,
|
0x74, 0x6f, 0x1a, 0x21, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32,
|
||||||
0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x2e,
|
0x2f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x2e,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x02, 0x0a, 0x14, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43,
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xeb, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43,
|
||||||
0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x3a,
|
0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x3a,
|
||||||
0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22,
|
0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22,
|
||||||
0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31,
|
0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31,
|
||||||
@@ -461,126 +461,117 @@ var file_proto_eth_v2_beacon_lightclient_proto_rawDesc = []byte{
|
|||||||
0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e,
|
0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e,
|
||||||
0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72,
|
0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72,
|
||||||
0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65,
|
0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65,
|
||||||
0x12, 0x6d, 0x0a, 0x1d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63,
|
0x12, 0x41, 0x0a, 0x1d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63,
|
||||||
0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63,
|
0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63,
|
||||||
0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x2a, 0x8a, 0xb5, 0x18, 0x26, 0x63, 0x75, 0x72,
|
0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74,
|
||||||
0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, 0x61,
|
||||||
0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x2e, 0x64, 0x65, 0x70, 0x74, 0x68,
|
0x6e, 0x63, 0x68, 0x22, 0x9a, 0x04, 0x0a, 0x11, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69,
|
||||||
0x2c, 0x33, 0x32, 0x52, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x79, 0x6e, 0x63,
|
0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x61, 0x74, 0x74,
|
||||||
0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22,
|
0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01,
|
||||||
0xe1, 0x04, 0x0a, 0x11, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55,
|
0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74,
|
||||||
0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65,
|
0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
|
||||||
0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22,
|
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64,
|
||||||
0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31,
|
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73,
|
||||||
0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64,
|
0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20,
|
||||||
0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64,
|
0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65,
|
||||||
0x65, 0x72, 0x12, 0x4e, 0x0a, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f,
|
0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
|
||||||
0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
0x74, 0x65, 0x65, 0x52, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d,
|
||||||
0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76,
|
0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x12, 0x3b, 0x0a, 0x1a, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73,
|
||||||
0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x52,
|
0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72,
|
||||||
0x11, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74,
|
0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x17, 0x6e, 0x65, 0x78, 0x74,
|
||||||
0x65, 0x65, 0x12, 0x64, 0x0a, 0x1a, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f,
|
0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x42, 0x72, 0x61,
|
||||||
0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68,
|
0x6e, 0x63, 0x68, 0x12, 0x4d, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64,
|
||||||
0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x27, 0x8a, 0xb5, 0x18, 0x23, 0x6e, 0x65, 0x78, 0x74,
|
0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e,
|
||||||
0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f,
|
0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e,
|
||||||
0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x2e, 0x64, 0x65, 0x70, 0x74, 0x68, 0x2c, 0x33, 0x32, 0x52,
|
0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65,
|
||||||
0x17, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74,
|
0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64,
|
||||||
0x65, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x4d, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x61,
|
0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x62,
|
||||||
0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01,
|
0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x66, 0x69, 0x6e,
|
||||||
|
0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x45, 0x0a, 0x0e, 0x73,
|
||||||
|
0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20,
|
||||||
|
0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65,
|
||||||
|
0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67,
|
||||||
|
0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61,
|
||||||
|
0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f,
|
||||||
|
0x73, 0x6c, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41,
|
||||||
|
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d,
|
||||||
|
0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76,
|
||||||
|
0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65,
|
||||||
|
0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f,
|
||||||
|
0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74,
|
||||||
|
0x22, 0x9a, 0x01, 0x0a, 0x24, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
|
||||||
|
0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x69,
|
||||||
|
0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72,
|
||||||
|
0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68,
|
||||||
|
0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72,
|
||||||
|
0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a,
|
||||||
|
0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x65, 0x74,
|
||||||
|
0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69,
|
||||||
|
0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74,
|
||||||
|
0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x95, 0x03,
|
||||||
|
0x0a, 0x19, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6e,
|
||||||
|
0x61, 0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x61,
|
||||||
|
0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01,
|
||||||
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e,
|
||||||
|
0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f,
|
||||||
|
0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74,
|
||||||
|
0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x61,
|
||||||
|
0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74,
|
0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74,
|
||||||
0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
|
0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
|
||||||
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65,
|
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65,
|
||||||
0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c,
|
0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c,
|
||||||
0x69, 0x74, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c,
|
0x69, 0x74, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c,
|
||||||
0x42, 0x1c, 0x8a, 0xb5, 0x18, 0x18, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x62,
|
0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68,
|
||||||
0x72, 0x61, 0x6e, 0x63, 0x68, 0x2e, 0x64, 0x65, 0x70, 0x74, 0x68, 0x2c, 0x33, 0x32, 0x52, 0x0e,
|
0x12, 0x45, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61,
|
||||||
0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x45,
|
0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72,
|
||||||
0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65,
|
0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41,
|
||||||
0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
|
0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67,
|
||||||
0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67,
|
0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61,
|
||||||
0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72,
|
0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42,
|
||||||
0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75,
|
0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||||
0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82,
|
0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72,
|
||||||
0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72,
|
0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73,
|
||||||
0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73,
|
0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65,
|
||||||
0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74,
|
0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72,
|
||||||
0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e,
|
0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x26, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43,
|
||||||
0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53,
|
0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x55,
|
||||||
0x6c, 0x6f, 0x74, 0x22, 0x9a, 0x01, 0x0a, 0x24, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69,
|
0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
||||||
0x65, 0x6e, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74,
|
0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
0x65, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07,
|
0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68,
|
||||||
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e,
|
0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72,
|
||||||
0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e,
|
0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74,
|
||||||
0x12, 0x3e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a,
|
0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
|
||||||
0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32,
|
0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
||||||
0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6e, 0x61,
|
0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x9f, 0x02, 0x0a, 0x1b, 0x4c, 0x69, 0x67, 0x68, 0x74,
|
||||||
0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
|
|
||||||
0x22, 0xb3, 0x03, 0x0a, 0x19, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
|
|
||||||
0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b,
|
|
||||||
0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65,
|
|
||||||
0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65,
|
|
||||||
0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e,
|
|
||||||
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74,
|
|
||||||
0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x10, 0x66,
|
|
||||||
0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18,
|
|
||||||
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
|
|
||||||
0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c,
|
|
||||||
0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0f, 0x66, 0x69, 0x6e, 0x61, 0x6c,
|
|
||||||
0x69, 0x7a, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0f, 0x66, 0x69,
|
|
||||||
0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20,
|
|
||||||
0x03, 0x28, 0x0c, 0x42, 0x1c, 0x8a, 0xb5, 0x18, 0x18, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74,
|
|
||||||
0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x2e, 0x64, 0x65, 0x70, 0x74, 0x68, 0x2c, 0x33,
|
|
||||||
0x32, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63,
|
|
||||||
0x68, 0x12, 0x45, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67,
|
|
||||||
0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74, 0x68, 0x65,
|
|
||||||
0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63,
|
|
||||||
0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x41,
|
|
||||||
0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e,
|
|
||||||
0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x05, 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, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75,
|
|
||||||
0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x26, 0x4c, 0x69, 0x67, 0x68, 0x74,
|
|
||||||
0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63,
|
0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63,
|
||||||
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
|
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74,
|
||||||
0x6e, 0x12, 0x32, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01,
|
0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||||
0x28, 0x0e, 0x32, 0x18, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74,
|
0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76,
|
||||||
0x68, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65,
|
0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61,
|
||||||
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20,
|
0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x61,
|
||||||
0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65,
|
0x64, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67, 0x72,
|
||||||
0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e,
|
0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x74,
|
||||||
0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x55, 0x70, 0x64, 0x61, 0x74,
|
0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79,
|
||||||
0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x9f, 0x02, 0x0a, 0x1b, 0x4c, 0x69, 0x67, 0x68,
|
0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79, 0x6e,
|
||||||
0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69,
|
0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73, 0x69,
|
||||||
0x63, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73,
|
0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01,
|
||||||
0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
|
||||||
0x32, 0x22, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e,
|
0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73,
|
||||||
0x76, 0x31, 0x2e, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65,
|
0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e,
|
||||||
0x61, 0x64, 0x65, 0x72, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65,
|
0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74,
|
||||||
0x61, 0x64, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0e, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x61, 0x67, 0x67,
|
0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61,
|
||||||
0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65,
|
0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x42, 0x83, 0x01, 0x0a, 0x13, 0x6f, 0x72, 0x67,
|
||||||
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53,
|
0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32,
|
||||||
0x79, 0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x73, 0x79,
|
0x42, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x50,
|
||||||
0x6e, 0x63, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x6c, 0x0a, 0x0e, 0x73,
|
0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
|
||||||
0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20,
|
0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73,
|
||||||
0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
|
||||||
0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62,
|
0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68,
|
||||||
0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65,
|
0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45,
|
||||||
0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69,
|
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06,
|
||||||
0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e,
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x42, 0x83, 0x01, 0x0a, 0x13, 0x6f, 0x72,
|
|
||||||
0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76,
|
|
||||||
0x32, 0x42, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65,
|
|
||||||
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
|
||||||
0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62,
|
|
||||||
0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
|
||||||
0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74,
|
|
||||||
0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f,
|
|
||||||
0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62,
|
|
||||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
452
proto/eth/v2/blobs.pb.go
generated
452
proto/eth/v2/blobs.pb.go
generated
@@ -1,452 +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/v2/blobs.proto
|
|
||||||
|
|
||||||
package eth
|
|
||||||
|
|
||||||
import (
|
|
||||||
reflect "reflect"
|
|
||||||
sync "sync"
|
|
||||||
|
|
||||||
github_com_prysmaticlabs_prysm_v4_consensus_types_primitives "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
|
||||||
_ "github.com/prysmaticlabs/prysm/v4/proto/eth/ext"
|
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
||||||
)
|
|
||||||
|
|
||||||
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)
|
|
||||||
)
|
|
||||||
|
|
||||||
type BlobSidecars struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
Sidecars []*BlobSidecar `protobuf:"bytes,1,rep,name=sidecars,proto3" json:"sidecars,omitempty" ssz-max:"6"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobSidecars) Reset() {
|
|
||||||
*x = BlobSidecars{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_proto_eth_v2_blobs_proto_msgTypes[0]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobSidecars) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*BlobSidecars) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *BlobSidecars) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_proto_eth_v2_blobs_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 BlobSidecars.ProtoReflect.Descriptor instead.
|
|
||||||
func (*BlobSidecars) Descriptor() ([]byte, []int) {
|
|
||||||
return file_proto_eth_v2_blobs_proto_rawDescGZIP(), []int{0}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobSidecars) GetSidecars() []*BlobSidecar {
|
|
||||||
if x != nil {
|
|
||||||
return x.Sidecars
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type BlobSidecar 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"`
|
|
||||||
BlockParentRoot []byte `protobuf:"bytes,4,opt,name=block_parent_root,json=blockParentRoot,proto3" json:"block_parent_root,omitempty" ssz-size:"32"`
|
|
||||||
ProposerIndex github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex `protobuf:"varint,5,opt,name=proposer_index,json=proposerIndex,proto3" json:"proposer_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"`
|
|
||||||
Blob []byte `protobuf:"bytes,6,opt,name=blob,proto3" json:"blob,omitempty" ssz-size:"131072"`
|
|
||||||
KzgCommitment []byte `protobuf:"bytes,7,opt,name=kzg_commitment,json=kzgCommitment,proto3" json:"kzg_commitment,omitempty" ssz-size:"48"`
|
|
||||||
KzgProof []byte `protobuf:"bytes,8,opt,name=kzg_proof,json=kzgProof,proto3" json:"kzg_proof,omitempty" ssz-size:"48"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobSidecar) Reset() {
|
|
||||||
*x = BlobSidecar{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_proto_eth_v2_blobs_proto_msgTypes[1]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobSidecar) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*BlobSidecar) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *BlobSidecar) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_proto_eth_v2_blobs_proto_msgTypes[1]
|
|
||||||
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 BlobSidecar.ProtoReflect.Descriptor instead.
|
|
||||||
func (*BlobSidecar) Descriptor() ([]byte, []int) {
|
|
||||||
return file_proto_eth_v2_blobs_proto_rawDescGZIP(), []int{1}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobSidecar) GetBlockRoot() []byte {
|
|
||||||
if x != nil {
|
|
||||||
return x.BlockRoot
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobSidecar) GetIndex() uint64 {
|
|
||||||
if x != nil {
|
|
||||||
return x.Index
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobSidecar) 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 *BlobSidecar) GetBlockParentRoot() []byte {
|
|
||||||
if x != nil {
|
|
||||||
return x.BlockParentRoot
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobSidecar) 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 *BlobSidecar) GetBlob() []byte {
|
|
||||||
if x != nil {
|
|
||||||
return x.Blob
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobSidecar) GetKzgCommitment() []byte {
|
|
||||||
if x != nil {
|
|
||||||
return x.KzgCommitment
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobSidecar) GetKzgProof() []byte {
|
|
||||||
if x != nil {
|
|
||||||
return x.KzgProof
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type SignedBlobSidecar struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
Message *BlobSidecar `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
|
|
||||||
Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *SignedBlobSidecar) Reset() {
|
|
||||||
*x = SignedBlobSidecar{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_proto_eth_v2_blobs_proto_msgTypes[2]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *SignedBlobSidecar) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*SignedBlobSidecar) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *SignedBlobSidecar) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_proto_eth_v2_blobs_proto_msgTypes[2]
|
|
||||||
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 SignedBlobSidecar.ProtoReflect.Descriptor instead.
|
|
||||||
func (*SignedBlobSidecar) Descriptor() ([]byte, []int) {
|
|
||||||
return file_proto_eth_v2_blobs_proto_rawDescGZIP(), []int{2}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *SignedBlobSidecar) GetMessage() *BlobSidecar {
|
|
||||||
if x != nil {
|
|
||||||
return x.Message
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *SignedBlobSidecar) GetSignature() []byte {
|
|
||||||
if x != nil {
|
|
||||||
return x.Signature
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type BlobIdentifier 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"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobIdentifier) Reset() {
|
|
||||||
*x = BlobIdentifier{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_proto_eth_v2_blobs_proto_msgTypes[3]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobIdentifier) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*BlobIdentifier) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *BlobIdentifier) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_proto_eth_v2_blobs_proto_msgTypes[3]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use BlobIdentifier.ProtoReflect.Descriptor instead.
|
|
||||||
func (*BlobIdentifier) Descriptor() ([]byte, []int) {
|
|
||||||
return file_proto_eth_v2_blobs_proto_rawDescGZIP(), []int{3}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobIdentifier) GetBlockRoot() []byte {
|
|
||||||
if x != nil {
|
|
||||||
return x.BlockRoot
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *BlobIdentifier) GetIndex() uint64 {
|
|
||||||
if x != nil {
|
|
||||||
return x.Index
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
var File_proto_eth_v2_blobs_proto protoreflect.FileDescriptor
|
|
||||||
|
|
||||||
var file_proto_eth_v2_blobs_proto_rawDesc = []byte{
|
|
||||||
0x0a, 0x18, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x62,
|
|
||||||
0x6c, 0x6f, 0x62, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x65, 0x74, 0x68, 0x65,
|
|
||||||
0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x1a, 0x1b, 0x70, 0x72, 0x6f,
|
|
||||||
0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f,
|
|
||||||
0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4f, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x62,
|
|
||||||
0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x12, 0x3f, 0x0a, 0x08, 0x73, 0x69, 0x64, 0x65,
|
|
||||||
0x63, 0x61, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x74, 0x68,
|
|
||||||
0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x6c, 0x6f,
|
|
||||||
0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x36, 0x52,
|
|
||||||
0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x22, 0xc5, 0x03, 0x0a, 0x0b, 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, 0x32, 0x0a, 0x11, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e,
|
|
||||||
0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5,
|
|
||||||
0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x65, 0x6e,
|
|
||||||
0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65,
|
|
||||||
0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 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, 0x1e, 0x0a,
|
|
||||||
0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18,
|
|
||||||
0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x2d, 0x0a,
|
|
||||||
0x0e, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18,
|
|
||||||
0x07, 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, 0x12, 0x23, 0x0a, 0x09,
|
|
||||||
0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x42,
|
|
||||||
0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f,
|
|
||||||
0x66, 0x22, 0x71, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53,
|
|
||||||
0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x36, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
|
||||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65,
|
|
||||||
0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69,
|
|
||||||
0x64, 0x65, 0x63, 0x61, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24,
|
|
||||||
0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
|
||||||
0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61,
|
|
||||||
0x74, 0x75, 0x72, 0x65, 0x22, 0x4d, 0x0a, 0x0e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x65, 0x6e,
|
|
||||||
0x74, 0x69, 0x66, 0x69, 0x65, 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, 0x42, 0x7b, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72,
|
|
||||||
0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x0a, 0x42, 0x6c, 0x6f, 0x62,
|
|
||||||
0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
|
||||||
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61,
|
|
||||||
0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
|
||||||
0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45,
|
|
||||||
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x32, 0xca, 0x02,
|
|
||||||
0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x32,
|
|
||||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
file_proto_eth_v2_blobs_proto_rawDescOnce sync.Once
|
|
||||||
file_proto_eth_v2_blobs_proto_rawDescData = file_proto_eth_v2_blobs_proto_rawDesc
|
|
||||||
)
|
|
||||||
|
|
||||||
func file_proto_eth_v2_blobs_proto_rawDescGZIP() []byte {
|
|
||||||
file_proto_eth_v2_blobs_proto_rawDescOnce.Do(func() {
|
|
||||||
file_proto_eth_v2_blobs_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_eth_v2_blobs_proto_rawDescData)
|
|
||||||
})
|
|
||||||
return file_proto_eth_v2_blobs_proto_rawDescData
|
|
||||||
}
|
|
||||||
|
|
||||||
var file_proto_eth_v2_blobs_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
|
||||||
var file_proto_eth_v2_blobs_proto_goTypes = []interface{}{
|
|
||||||
(*BlobSidecars)(nil), // 0: ethereum.eth.v2.BlobSidecars
|
|
||||||
(*BlobSidecar)(nil), // 1: ethereum.eth.v2.BlobSidecar
|
|
||||||
(*SignedBlobSidecar)(nil), // 2: ethereum.eth.v2.SignedBlobSidecar
|
|
||||||
(*BlobIdentifier)(nil), // 3: ethereum.eth.v2.BlobIdentifier
|
|
||||||
}
|
|
||||||
var file_proto_eth_v2_blobs_proto_depIdxs = []int32{
|
|
||||||
1, // 0: ethereum.eth.v2.BlobSidecars.sidecars:type_name -> ethereum.eth.v2.BlobSidecar
|
|
||||||
1, // 1: ethereum.eth.v2.SignedBlobSidecar.message:type_name -> ethereum.eth.v2.BlobSidecar
|
|
||||||
2, // [2:2] is the sub-list for method output_type
|
|
||||||
2, // [2:2] is the sub-list for method input_type
|
|
||||||
2, // [2:2] is the sub-list for extension type_name
|
|
||||||
2, // [2:2] is the sub-list for extension extendee
|
|
||||||
0, // [0:2] is the sub-list for field type_name
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { file_proto_eth_v2_blobs_proto_init() }
|
|
||||||
func file_proto_eth_v2_blobs_proto_init() {
|
|
||||||
if File_proto_eth_v2_blobs_proto != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if !protoimpl.UnsafeEnabled {
|
|
||||||
file_proto_eth_v2_blobs_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*BlobSidecars); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file_proto_eth_v2_blobs_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*BlobSidecar); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file_proto_eth_v2_blobs_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*SignedBlobSidecar); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file_proto_eth_v2_blobs_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*BlobIdentifier); 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{
|
|
||||||
File: protoimpl.DescBuilder{
|
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
||||||
RawDescriptor: file_proto_eth_v2_blobs_proto_rawDesc,
|
|
||||||
NumEnums: 0,
|
|
||||||
NumMessages: 4,
|
|
||||||
NumExtensions: 0,
|
|
||||||
NumServices: 0,
|
|
||||||
},
|
|
||||||
GoTypes: file_proto_eth_v2_blobs_proto_goTypes,
|
|
||||||
DependencyIndexes: file_proto_eth_v2_blobs_proto_depIdxs,
|
|
||||||
MessageInfos: file_proto_eth_v2_blobs_proto_msgTypes,
|
|
||||||
}.Build()
|
|
||||||
File_proto_eth_v2_blobs_proto = out.File
|
|
||||||
file_proto_eth_v2_blobs_proto_rawDesc = nil
|
|
||||||
file_proto_eth_v2_blobs_proto_goTypes = nil
|
|
||||||
file_proto_eth_v2_blobs_proto_depIdxs = nil
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
//go:build ignore
|
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package ignore
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
// Copyright 2023 Prysmatic Labs.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package ethereum.eth.v2;
|
|
||||||
|
|
||||||
import "proto/eth/ext/options.proto";
|
|
||||||
|
|
||||||
option csharp_namespace = "Ethereum.Eth.V2";
|
|
||||||
option go_package = "github.com/prysmaticlabs/prysm/v4/proto/eth/v2;eth";
|
|
||||||
option java_multiple_files = true;
|
|
||||||
option java_outer_classname = "BlobsProto";
|
|
||||||
option java_package = "org.ethereum.eth.v2";
|
|
||||||
option php_namespace = "Ethereum\\Eth\\v2";
|
|
||||||
|
|
||||||
message BlobSidecars {
|
|
||||||
repeated BlobSidecar sidecars = 1 [(ethereum.eth.ext.ssz_max) = "max_blobs_per_block.size"];
|
|
||||||
}
|
|
||||||
|
|
||||||
message BlobSidecar {
|
|
||||||
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"];
|
|
||||||
bytes block_parent_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
||||||
uint64 proposer_index = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"];
|
|
||||||
bytes blob = 6 [(ethereum.eth.ext.ssz_size) = "blob.size"];
|
|
||||||
bytes kzg_commitment = 7 [(ethereum.eth.ext.ssz_size) = "48"];
|
|
||||||
bytes kzg_proof = 8 [(ethereum.eth.ext.ssz_size) = "48"];
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: remove after blob sidecar inclusion proof format is used
|
|
||||||
message SignedBlobSidecar {
|
|
||||||
BlobSidecar message = 1;
|
|
||||||
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
|
|
||||||
}
|
|
||||||
|
|
||||||
message BlobIdentifier {
|
|
||||||
bytes block_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
||||||
uint64 index = 2;
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// Code generated by fastssz. DO NOT EDIT.
|
// Code generated by fastssz. DO NOT EDIT.
|
||||||
// Hash: 24b4ff1ff2687dd72a0cfff3f32e441ca176f59386745cf0be141593d877fc9a
|
// Hash: 80045ff1d2d5fb4ddf3cdb266ca12357a1138b370a8f30ac8ce19ddabd084b2b
|
||||||
package eth
|
package eth
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -5796,7 +5796,7 @@ func (s *SignedBeaconBlockContentsDeneb) MarshalSSZ() ([]byte, error) {
|
|||||||
// MarshalSSZTo ssz marshals the SignedBeaconBlockContentsDeneb object to a target array
|
// MarshalSSZTo ssz marshals the SignedBeaconBlockContentsDeneb object to a target array
|
||||||
func (s *SignedBeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
func (s *SignedBeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||||
dst = buf
|
dst = buf
|
||||||
offset := int(8)
|
offset := int(12)
|
||||||
|
|
||||||
// Offset (0) 'SignedBlock'
|
// Offset (0) 'SignedBlock'
|
||||||
dst = ssz.WriteOffset(dst, offset)
|
dst = ssz.WriteOffset(dst, offset)
|
||||||
@@ -5805,24 +5805,43 @@ func (s *SignedBeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, e
|
|||||||
}
|
}
|
||||||
offset += s.SignedBlock.SizeSSZ()
|
offset += s.SignedBlock.SizeSSZ()
|
||||||
|
|
||||||
// Offset (1) 'SignedBlobSidecars'
|
// Offset (1) 'KzgProofs'
|
||||||
dst = ssz.WriteOffset(dst, offset)
|
dst = ssz.WriteOffset(dst, offset)
|
||||||
offset += len(s.SignedBlobSidecars) * 131352
|
offset += len(s.KzgProofs) * 48
|
||||||
|
|
||||||
|
// Offset (2) 'Blobs'
|
||||||
|
dst = ssz.WriteOffset(dst, offset)
|
||||||
|
offset += len(s.Blobs) * 131072
|
||||||
|
|
||||||
// Field (0) 'SignedBlock'
|
// Field (0) 'SignedBlock'
|
||||||
if dst, err = s.SignedBlock.MarshalSSZTo(dst); err != nil {
|
if dst, err = s.SignedBlock.MarshalSSZTo(dst); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Field (1) 'SignedBlobSidecars'
|
// Field (1) 'KzgProofs'
|
||||||
if size := len(s.SignedBlobSidecars); size > 6 {
|
if size := len(s.KzgProofs); size > 4096 {
|
||||||
err = ssz.ErrListTooBigFn("--.SignedBlobSidecars", size, 6)
|
err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for ii := 0; ii < len(s.SignedBlobSidecars); ii++ {
|
for ii := 0; ii < len(s.KzgProofs); ii++ {
|
||||||
if dst, err = s.SignedBlobSidecars[ii].MarshalSSZTo(dst); err != nil {
|
if size := len(s.KzgProofs[ii]); size != 48 {
|
||||||
|
err = ssz.ErrBytesLengthFn("--.KzgProofs[ii]", size, 48)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
dst = append(dst, s.KzgProofs[ii]...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field (2) 'Blobs'
|
||||||
|
if size := len(s.Blobs); size > 4096 {
|
||||||
|
err = ssz.ErrListTooBigFn("--.Blobs", size, 4096)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for ii := 0; ii < len(s.Blobs); ii++ {
|
||||||
|
if size := len(s.Blobs[ii]); size != 131072 {
|
||||||
|
err = ssz.ErrBytesLengthFn("--.Blobs[ii]", size, 131072)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dst = append(dst, s.Blobs[ii]...)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
@@ -5832,27 +5851,32 @@ func (s *SignedBeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, e
|
|||||||
func (s *SignedBeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error {
|
func (s *SignedBeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error {
|
||||||
var err error
|
var err error
|
||||||
size := uint64(len(buf))
|
size := uint64(len(buf))
|
||||||
if size < 8 {
|
if size < 12 {
|
||||||
return ssz.ErrSize
|
return ssz.ErrSize
|
||||||
}
|
}
|
||||||
|
|
||||||
tail := buf
|
tail := buf
|
||||||
var o0, o1 uint64
|
var o0, o1, o2 uint64
|
||||||
|
|
||||||
// Offset (0) 'SignedBlock'
|
// Offset (0) 'SignedBlock'
|
||||||
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
|
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
|
||||||
return ssz.ErrOffset
|
return ssz.ErrOffset
|
||||||
}
|
}
|
||||||
|
|
||||||
if o0 < 8 {
|
if o0 < 12 {
|
||||||
return ssz.ErrInvalidVariableOffset
|
return ssz.ErrInvalidVariableOffset
|
||||||
}
|
}
|
||||||
|
|
||||||
// Offset (1) 'SignedBlobSidecars'
|
// Offset (1) 'KzgProofs'
|
||||||
if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 {
|
if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 {
|
||||||
return ssz.ErrOffset
|
return ssz.ErrOffset
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Offset (2) 'Blobs'
|
||||||
|
if o2 = ssz.ReadOffset(buf[8:12]); o2 > size || o1 > o2 {
|
||||||
|
return ssz.ErrOffset
|
||||||
|
}
|
||||||
|
|
||||||
// Field (0) 'SignedBlock'
|
// Field (0) 'SignedBlock'
|
||||||
{
|
{
|
||||||
buf = tail[o0:o1]
|
buf = tail[o0:o1]
|
||||||
@@ -5864,21 +5888,35 @@ func (s *SignedBeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Field (1) 'SignedBlobSidecars'
|
// Field (1) 'KzgProofs'
|
||||||
{
|
{
|
||||||
buf = tail[o1:]
|
buf = tail[o1:o2]
|
||||||
num, err := ssz.DivideInt2(len(buf), 131352, 6)
|
num, err := ssz.DivideInt2(len(buf), 48, 4096)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
s.SignedBlobSidecars = make([]*SignedBlobSidecar, num)
|
s.KzgProofs = make([][]byte, num)
|
||||||
for ii := 0; ii < num; ii++ {
|
for ii := 0; ii < num; ii++ {
|
||||||
if s.SignedBlobSidecars[ii] == nil {
|
if cap(s.KzgProofs[ii]) == 0 {
|
||||||
s.SignedBlobSidecars[ii] = new(SignedBlobSidecar)
|
s.KzgProofs[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48]))
|
||||||
}
|
}
|
||||||
if err = s.SignedBlobSidecars[ii].UnmarshalSSZ(buf[ii*131352 : (ii+1)*131352]); err != nil {
|
s.KzgProofs[ii] = append(s.KzgProofs[ii], buf[ii*48:(ii+1)*48]...)
|
||||||
return err
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field (2) 'Blobs'
|
||||||
|
{
|
||||||
|
buf = tail[o2:]
|
||||||
|
num, err := ssz.DivideInt2(len(buf), 131072, 4096)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
s.Blobs = make([][]byte, num)
|
||||||
|
for ii := 0; ii < num; ii++ {
|
||||||
|
if cap(s.Blobs[ii]) == 0 {
|
||||||
|
s.Blobs[ii] = make([]byte, 0, len(buf[ii*131072:(ii+1)*131072]))
|
||||||
}
|
}
|
||||||
|
s.Blobs[ii] = append(s.Blobs[ii], buf[ii*131072:(ii+1)*131072]...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
@@ -5886,7 +5924,7 @@ func (s *SignedBeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error {
|
|||||||
|
|
||||||
// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockContentsDeneb object
|
// SizeSSZ returns the ssz encoded size in bytes for the SignedBeaconBlockContentsDeneb object
|
||||||
func (s *SignedBeaconBlockContentsDeneb) SizeSSZ() (size int) {
|
func (s *SignedBeaconBlockContentsDeneb) SizeSSZ() (size int) {
|
||||||
size = 8
|
size = 12
|
||||||
|
|
||||||
// Field (0) 'SignedBlock'
|
// Field (0) 'SignedBlock'
|
||||||
if s.SignedBlock == nil {
|
if s.SignedBlock == nil {
|
||||||
@@ -5894,8 +5932,11 @@ func (s *SignedBeaconBlockContentsDeneb) SizeSSZ() (size int) {
|
|||||||
}
|
}
|
||||||
size += s.SignedBlock.SizeSSZ()
|
size += s.SignedBlock.SizeSSZ()
|
||||||
|
|
||||||
// Field (1) 'SignedBlobSidecars'
|
// Field (1) 'KzgProofs'
|
||||||
size += len(s.SignedBlobSidecars) * 131352
|
size += len(s.KzgProofs) * 48
|
||||||
|
|
||||||
|
// Field (2) 'Blobs'
|
||||||
|
size += len(s.Blobs) * 131072
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -5914,23 +5955,49 @@ func (s *SignedBeaconBlockContentsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err e
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Field (1) 'SignedBlobSidecars'
|
// Field (1) 'KzgProofs'
|
||||||
{
|
{
|
||||||
subIndx := hh.Index()
|
if size := len(s.KzgProofs); size > 4096 {
|
||||||
num := uint64(len(s.SignedBlobSidecars))
|
err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096)
|
||||||
if num > 6 {
|
|
||||||
err = ssz.ErrIncorrectListSize
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, elem := range s.SignedBlobSidecars {
|
subIndx := hh.Index()
|
||||||
if err = elem.HashTreeRootWith(hh); err != nil {
|
for _, i := range s.KzgProofs {
|
||||||
|
if len(i) != 48 {
|
||||||
|
err = ssz.ErrBytesLength
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
hh.PutBytes(i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
numItems := uint64(len(s.KzgProofs))
|
||||||
if ssz.EnableVectorizedHTR {
|
if ssz.EnableVectorizedHTR {
|
||||||
hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 6)
|
hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096)
|
||||||
} else {
|
} else {
|
||||||
hh.MerkleizeWithMixin(subIndx, num, 6)
|
hh.MerkleizeWithMixin(subIndx, numItems, 4096)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field (2) 'Blobs'
|
||||||
|
{
|
||||||
|
if size := len(s.Blobs); size > 4096 {
|
||||||
|
err = ssz.ErrListTooBigFn("--.Blobs", size, 4096)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
subIndx := hh.Index()
|
||||||
|
for _, i := range s.Blobs {
|
||||||
|
if len(i) != 131072 {
|
||||||
|
err = ssz.ErrBytesLength
|
||||||
|
return
|
||||||
|
}
|
||||||
|
hh.PutBytes(i)
|
||||||
|
}
|
||||||
|
|
||||||
|
numItems := uint64(len(s.Blobs))
|
||||||
|
if ssz.EnableVectorizedHTR {
|
||||||
|
hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096)
|
||||||
|
} else {
|
||||||
|
hh.MerkleizeWithMixin(subIndx, numItems, 4096)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5950,7 +6017,7 @@ func (b *BeaconBlockContentsDeneb) MarshalSSZ() ([]byte, error) {
|
|||||||
// MarshalSSZTo ssz marshals the BeaconBlockContentsDeneb object to a target array
|
// MarshalSSZTo ssz marshals the BeaconBlockContentsDeneb object to a target array
|
||||||
func (b *BeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
func (b *BeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||||
dst = buf
|
dst = buf
|
||||||
offset := int(8)
|
offset := int(12)
|
||||||
|
|
||||||
// Offset (0) 'Block'
|
// Offset (0) 'Block'
|
||||||
dst = ssz.WriteOffset(dst, offset)
|
dst = ssz.WriteOffset(dst, offset)
|
||||||
@@ -5959,24 +6026,43 @@ func (b *BeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err err
|
|||||||
}
|
}
|
||||||
offset += b.Block.SizeSSZ()
|
offset += b.Block.SizeSSZ()
|
||||||
|
|
||||||
// Offset (1) 'BlobSidecars'
|
// Offset (1) 'KzgProofs'
|
||||||
dst = ssz.WriteOffset(dst, offset)
|
dst = ssz.WriteOffset(dst, offset)
|
||||||
offset += len(b.BlobSidecars) * 131256
|
offset += len(b.KzgProofs) * 48
|
||||||
|
|
||||||
|
// Offset (2) 'Blobs'
|
||||||
|
dst = ssz.WriteOffset(dst, offset)
|
||||||
|
offset += len(b.Blobs) * 131072
|
||||||
|
|
||||||
// Field (0) 'Block'
|
// Field (0) 'Block'
|
||||||
if dst, err = b.Block.MarshalSSZTo(dst); err != nil {
|
if dst, err = b.Block.MarshalSSZTo(dst); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Field (1) 'BlobSidecars'
|
// Field (1) 'KzgProofs'
|
||||||
if size := len(b.BlobSidecars); size > 6 {
|
if size := len(b.KzgProofs); size > 4096 {
|
||||||
err = ssz.ErrListTooBigFn("--.BlobSidecars", size, 6)
|
err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for ii := 0; ii < len(b.BlobSidecars); ii++ {
|
for ii := 0; ii < len(b.KzgProofs); ii++ {
|
||||||
if dst, err = b.BlobSidecars[ii].MarshalSSZTo(dst); err != nil {
|
if size := len(b.KzgProofs[ii]); size != 48 {
|
||||||
|
err = ssz.ErrBytesLengthFn("--.KzgProofs[ii]", size, 48)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
dst = append(dst, b.KzgProofs[ii]...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field (2) 'Blobs'
|
||||||
|
if size := len(b.Blobs); size > 4096 {
|
||||||
|
err = ssz.ErrListTooBigFn("--.Blobs", size, 4096)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for ii := 0; ii < len(b.Blobs); ii++ {
|
||||||
|
if size := len(b.Blobs[ii]); size != 131072 {
|
||||||
|
err = ssz.ErrBytesLengthFn("--.Blobs[ii]", size, 131072)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dst = append(dst, b.Blobs[ii]...)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
@@ -5986,27 +6072,32 @@ func (b *BeaconBlockContentsDeneb) MarshalSSZTo(buf []byte) (dst []byte, err err
|
|||||||
func (b *BeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error {
|
func (b *BeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error {
|
||||||
var err error
|
var err error
|
||||||
size := uint64(len(buf))
|
size := uint64(len(buf))
|
||||||
if size < 8 {
|
if size < 12 {
|
||||||
return ssz.ErrSize
|
return ssz.ErrSize
|
||||||
}
|
}
|
||||||
|
|
||||||
tail := buf
|
tail := buf
|
||||||
var o0, o1 uint64
|
var o0, o1, o2 uint64
|
||||||
|
|
||||||
// Offset (0) 'Block'
|
// Offset (0) 'Block'
|
||||||
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
|
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
|
||||||
return ssz.ErrOffset
|
return ssz.ErrOffset
|
||||||
}
|
}
|
||||||
|
|
||||||
if o0 < 8 {
|
if o0 < 12 {
|
||||||
return ssz.ErrInvalidVariableOffset
|
return ssz.ErrInvalidVariableOffset
|
||||||
}
|
}
|
||||||
|
|
||||||
// Offset (1) 'BlobSidecars'
|
// Offset (1) 'KzgProofs'
|
||||||
if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 {
|
if o1 = ssz.ReadOffset(buf[4:8]); o1 > size || o0 > o1 {
|
||||||
return ssz.ErrOffset
|
return ssz.ErrOffset
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Offset (2) 'Blobs'
|
||||||
|
if o2 = ssz.ReadOffset(buf[8:12]); o2 > size || o1 > o2 {
|
||||||
|
return ssz.ErrOffset
|
||||||
|
}
|
||||||
|
|
||||||
// Field (0) 'Block'
|
// Field (0) 'Block'
|
||||||
{
|
{
|
||||||
buf = tail[o0:o1]
|
buf = tail[o0:o1]
|
||||||
@@ -6018,21 +6109,35 @@ func (b *BeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Field (1) 'BlobSidecars'
|
// Field (1) 'KzgProofs'
|
||||||
{
|
{
|
||||||
buf = tail[o1:]
|
buf = tail[o1:o2]
|
||||||
num, err := ssz.DivideInt2(len(buf), 131256, 6)
|
num, err := ssz.DivideInt2(len(buf), 48, 4096)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
b.BlobSidecars = make([]*BlobSidecar, num)
|
b.KzgProofs = make([][]byte, num)
|
||||||
for ii := 0; ii < num; ii++ {
|
for ii := 0; ii < num; ii++ {
|
||||||
if b.BlobSidecars[ii] == nil {
|
if cap(b.KzgProofs[ii]) == 0 {
|
||||||
b.BlobSidecars[ii] = new(BlobSidecar)
|
b.KzgProofs[ii] = make([]byte, 0, len(buf[ii*48:(ii+1)*48]))
|
||||||
}
|
}
|
||||||
if err = b.BlobSidecars[ii].UnmarshalSSZ(buf[ii*131256 : (ii+1)*131256]); err != nil {
|
b.KzgProofs[ii] = append(b.KzgProofs[ii], buf[ii*48:(ii+1)*48]...)
|
||||||
return err
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field (2) 'Blobs'
|
||||||
|
{
|
||||||
|
buf = tail[o2:]
|
||||||
|
num, err := ssz.DivideInt2(len(buf), 131072, 4096)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
b.Blobs = make([][]byte, num)
|
||||||
|
for ii := 0; ii < num; ii++ {
|
||||||
|
if cap(b.Blobs[ii]) == 0 {
|
||||||
|
b.Blobs[ii] = make([]byte, 0, len(buf[ii*131072:(ii+1)*131072]))
|
||||||
}
|
}
|
||||||
|
b.Blobs[ii] = append(b.Blobs[ii], buf[ii*131072:(ii+1)*131072]...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
@@ -6040,7 +6145,7 @@ func (b *BeaconBlockContentsDeneb) UnmarshalSSZ(buf []byte) error {
|
|||||||
|
|
||||||
// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockContentsDeneb object
|
// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockContentsDeneb object
|
||||||
func (b *BeaconBlockContentsDeneb) SizeSSZ() (size int) {
|
func (b *BeaconBlockContentsDeneb) SizeSSZ() (size int) {
|
||||||
size = 8
|
size = 12
|
||||||
|
|
||||||
// Field (0) 'Block'
|
// Field (0) 'Block'
|
||||||
if b.Block == nil {
|
if b.Block == nil {
|
||||||
@@ -6048,8 +6153,11 @@ func (b *BeaconBlockContentsDeneb) SizeSSZ() (size int) {
|
|||||||
}
|
}
|
||||||
size += b.Block.SizeSSZ()
|
size += b.Block.SizeSSZ()
|
||||||
|
|
||||||
// Field (1) 'BlobSidecars'
|
// Field (1) 'KzgProofs'
|
||||||
size += len(b.BlobSidecars) * 131256
|
size += len(b.KzgProofs) * 48
|
||||||
|
|
||||||
|
// Field (2) 'Blobs'
|
||||||
|
size += len(b.Blobs) * 131072
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -6068,23 +6176,49 @@ func (b *BeaconBlockContentsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Field (1) 'BlobSidecars'
|
// Field (1) 'KzgProofs'
|
||||||
{
|
{
|
||||||
subIndx := hh.Index()
|
if size := len(b.KzgProofs); size > 4096 {
|
||||||
num := uint64(len(b.BlobSidecars))
|
err = ssz.ErrListTooBigFn("--.KzgProofs", size, 4096)
|
||||||
if num > 6 {
|
|
||||||
err = ssz.ErrIncorrectListSize
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, elem := range b.BlobSidecars {
|
subIndx := hh.Index()
|
||||||
if err = elem.HashTreeRootWith(hh); err != nil {
|
for _, i := range b.KzgProofs {
|
||||||
|
if len(i) != 48 {
|
||||||
|
err = ssz.ErrBytesLength
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
hh.PutBytes(i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
numItems := uint64(len(b.KzgProofs))
|
||||||
if ssz.EnableVectorizedHTR {
|
if ssz.EnableVectorizedHTR {
|
||||||
hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 6)
|
hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096)
|
||||||
} else {
|
} else {
|
||||||
hh.MerkleizeWithMixin(subIndx, num, 6)
|
hh.MerkleizeWithMixin(subIndx, numItems, 4096)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field (2) 'Blobs'
|
||||||
|
{
|
||||||
|
if size := len(b.Blobs); size > 4096 {
|
||||||
|
err = ssz.ErrListTooBigFn("--.Blobs", size, 4096)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
subIndx := hh.Index()
|
||||||
|
for _, i := range b.Blobs {
|
||||||
|
if len(i) != 131072 {
|
||||||
|
err = ssz.ErrBytesLength
|
||||||
|
return
|
||||||
|
}
|
||||||
|
hh.PutBytes(i)
|
||||||
|
}
|
||||||
|
|
||||||
|
numItems := uint64(len(b.Blobs))
|
||||||
|
if ssz.EnableVectorizedHTR {
|
||||||
|
hh.MerkleizeWithMixinVectorizedHTR(subIndx, numItems, 4096)
|
||||||
|
} else {
|
||||||
|
hh.MerkleizeWithMixin(subIndx, numItems, 4096)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6096,128 +6230,13 @@ func (b *BeaconBlockContentsDeneb) HashTreeRootWith(hh *ssz.Hasher) (err error)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalSSZ ssz marshals the BlobSidecars object
|
// MarshalSSZ ssz marshals the BlobIdentifier object
|
||||||
func (b *BlobSidecars) MarshalSSZ() ([]byte, error) {
|
func (b *BlobIdentifier) MarshalSSZ() ([]byte, error) {
|
||||||
return ssz.MarshalSSZ(b)
|
return ssz.MarshalSSZ(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalSSZTo ssz marshals the BlobSidecars object to a target array
|
// MarshalSSZTo ssz marshals the BlobIdentifier object to a target array
|
||||||
func (b *BlobSidecars) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
func (b *BlobIdentifier) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||||
dst = buf
|
|
||||||
offset := int(4)
|
|
||||||
|
|
||||||
// Offset (0) 'Sidecars'
|
|
||||||
dst = ssz.WriteOffset(dst, offset)
|
|
||||||
offset += len(b.Sidecars) * 131256
|
|
||||||
|
|
||||||
// Field (0) 'Sidecars'
|
|
||||||
if size := len(b.Sidecars); size > 6 {
|
|
||||||
err = ssz.ErrListTooBigFn("--.Sidecars", size, 6)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for ii := 0; ii < len(b.Sidecars); ii++ {
|
|
||||||
if dst, err = b.Sidecars[ii].MarshalSSZTo(dst); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalSSZ ssz unmarshals the BlobSidecars object
|
|
||||||
func (b *BlobSidecars) UnmarshalSSZ(buf []byte) error {
|
|
||||||
var err error
|
|
||||||
size := uint64(len(buf))
|
|
||||||
if size < 4 {
|
|
||||||
return ssz.ErrSize
|
|
||||||
}
|
|
||||||
|
|
||||||
tail := buf
|
|
||||||
var o0 uint64
|
|
||||||
|
|
||||||
// Offset (0) 'Sidecars'
|
|
||||||
if o0 = ssz.ReadOffset(buf[0:4]); o0 > size {
|
|
||||||
return ssz.ErrOffset
|
|
||||||
}
|
|
||||||
|
|
||||||
if o0 < 4 {
|
|
||||||
return ssz.ErrInvalidVariableOffset
|
|
||||||
}
|
|
||||||
|
|
||||||
// Field (0) 'Sidecars'
|
|
||||||
{
|
|
||||||
buf = tail[o0:]
|
|
||||||
num, err := ssz.DivideInt2(len(buf), 131256, 6)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
b.Sidecars = make([]*BlobSidecar, num)
|
|
||||||
for ii := 0; ii < num; ii++ {
|
|
||||||
if b.Sidecars[ii] == nil {
|
|
||||||
b.Sidecars[ii] = new(BlobSidecar)
|
|
||||||
}
|
|
||||||
if err = b.Sidecars[ii].UnmarshalSSZ(buf[ii*131256 : (ii+1)*131256]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecars object
|
|
||||||
func (b *BlobSidecars) SizeSSZ() (size int) {
|
|
||||||
size = 4
|
|
||||||
|
|
||||||
// Field (0) 'Sidecars'
|
|
||||||
size += len(b.Sidecars) * 131256
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// HashTreeRoot ssz hashes the BlobSidecars object
|
|
||||||
func (b *BlobSidecars) HashTreeRoot() ([32]byte, error) {
|
|
||||||
return ssz.HashWithDefaultHasher(b)
|
|
||||||
}
|
|
||||||
|
|
||||||
// HashTreeRootWith ssz hashes the BlobSidecars object with a hasher
|
|
||||||
func (b *BlobSidecars) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
|
||||||
indx := hh.Index()
|
|
||||||
|
|
||||||
// Field (0) 'Sidecars'
|
|
||||||
{
|
|
||||||
subIndx := hh.Index()
|
|
||||||
num := uint64(len(b.Sidecars))
|
|
||||||
if num > 6 {
|
|
||||||
err = ssz.ErrIncorrectListSize
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for _, elem := range b.Sidecars {
|
|
||||||
if err = elem.HashTreeRootWith(hh); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ssz.EnableVectorizedHTR {
|
|
||||||
hh.MerkleizeWithMixinVectorizedHTR(subIndx, num, 6)
|
|
||||||
} else {
|
|
||||||
hh.MerkleizeWithMixin(subIndx, num, 6)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ssz.EnableVectorizedHTR {
|
|
||||||
hh.MerkleizeVectorizedHTR(indx)
|
|
||||||
} else {
|
|
||||||
hh.Merkleize(indx)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalSSZ ssz marshals the BlobSidecar object
|
|
||||||
func (b *BlobSidecar) MarshalSSZ() ([]byte, error) {
|
|
||||||
return ssz.MarshalSSZ(b)
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalSSZTo ssz marshals the BlobSidecar object to a target array
|
|
||||||
func (b *BlobSidecar) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
|
||||||
dst = buf
|
dst = buf
|
||||||
|
|
||||||
// Field (0) 'BlockRoot'
|
// Field (0) 'BlockRoot'
|
||||||
@@ -6230,48 +6249,14 @@ func (b *BlobSidecar) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
|||||||
// Field (1) 'Index'
|
// Field (1) 'Index'
|
||||||
dst = ssz.MarshalUint64(dst, b.Index)
|
dst = ssz.MarshalUint64(dst, b.Index)
|
||||||
|
|
||||||
// Field (2) 'Slot'
|
|
||||||
dst = ssz.MarshalUint64(dst, uint64(b.Slot))
|
|
||||||
|
|
||||||
// Field (3) 'BlockParentRoot'
|
|
||||||
if size := len(b.BlockParentRoot); size != 32 {
|
|
||||||
err = ssz.ErrBytesLengthFn("--.BlockParentRoot", size, 32)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
dst = append(dst, b.BlockParentRoot...)
|
|
||||||
|
|
||||||
// Field (4) 'ProposerIndex'
|
|
||||||
dst = ssz.MarshalUint64(dst, uint64(b.ProposerIndex))
|
|
||||||
|
|
||||||
// Field (5) 'Blob'
|
|
||||||
if size := len(b.Blob); size != 131072 {
|
|
||||||
err = ssz.ErrBytesLengthFn("--.Blob", size, 131072)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
dst = append(dst, b.Blob...)
|
|
||||||
|
|
||||||
// Field (6) 'KzgCommitment'
|
|
||||||
if size := len(b.KzgCommitment); size != 48 {
|
|
||||||
err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
dst = append(dst, b.KzgCommitment...)
|
|
||||||
|
|
||||||
// Field (7) 'KzgProof'
|
|
||||||
if size := len(b.KzgProof); size != 48 {
|
|
||||||
err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
dst = append(dst, b.KzgProof...)
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalSSZ ssz unmarshals the BlobSidecar object
|
// UnmarshalSSZ ssz unmarshals the BlobIdentifier object
|
||||||
func (b *BlobSidecar) UnmarshalSSZ(buf []byte) error {
|
func (b *BlobIdentifier) UnmarshalSSZ(buf []byte) error {
|
||||||
var err error
|
var err error
|
||||||
size := uint64(len(buf))
|
size := uint64(len(buf))
|
||||||
if size != 131256 {
|
if size != 40 {
|
||||||
return ssz.ErrSize
|
return ssz.ErrSize
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6284,52 +6269,22 @@ func (b *BlobSidecar) UnmarshalSSZ(buf []byte) error {
|
|||||||
// Field (1) 'Index'
|
// Field (1) 'Index'
|
||||||
b.Index = ssz.UnmarshallUint64(buf[32:40])
|
b.Index = ssz.UnmarshallUint64(buf[32:40])
|
||||||
|
|
||||||
// Field (2) 'Slot'
|
|
||||||
b.Slot = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[40:48]))
|
|
||||||
|
|
||||||
// Field (3) 'BlockParentRoot'
|
|
||||||
if cap(b.BlockParentRoot) == 0 {
|
|
||||||
b.BlockParentRoot = make([]byte, 0, len(buf[48:80]))
|
|
||||||
}
|
|
||||||
b.BlockParentRoot = append(b.BlockParentRoot, buf[48:80]...)
|
|
||||||
|
|
||||||
// Field (4) 'ProposerIndex'
|
|
||||||
b.ProposerIndex = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[80:88]))
|
|
||||||
|
|
||||||
// Field (5) 'Blob'
|
|
||||||
if cap(b.Blob) == 0 {
|
|
||||||
b.Blob = make([]byte, 0, len(buf[88:131160]))
|
|
||||||
}
|
|
||||||
b.Blob = append(b.Blob, buf[88:131160]...)
|
|
||||||
|
|
||||||
// Field (6) 'KzgCommitment'
|
|
||||||
if cap(b.KzgCommitment) == 0 {
|
|
||||||
b.KzgCommitment = make([]byte, 0, len(buf[131160:131208]))
|
|
||||||
}
|
|
||||||
b.KzgCommitment = append(b.KzgCommitment, buf[131160:131208]...)
|
|
||||||
|
|
||||||
// Field (7) 'KzgProof'
|
|
||||||
if cap(b.KzgProof) == 0 {
|
|
||||||
b.KzgProof = make([]byte, 0, len(buf[131208:131256]))
|
|
||||||
}
|
|
||||||
b.KzgProof = append(b.KzgProof, buf[131208:131256]...)
|
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// SizeSSZ returns the ssz encoded size in bytes for the BlobSidecar object
|
// SizeSSZ returns the ssz encoded size in bytes for the BlobIdentifier object
|
||||||
func (b *BlobSidecar) SizeSSZ() (size int) {
|
func (b *BlobIdentifier) SizeSSZ() (size int) {
|
||||||
size = 131256
|
size = 40
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// HashTreeRoot ssz hashes the BlobSidecar object
|
// HashTreeRoot ssz hashes the BlobIdentifier object
|
||||||
func (b *BlobSidecar) HashTreeRoot() ([32]byte, error) {
|
func (b *BlobIdentifier) HashTreeRoot() ([32]byte, error) {
|
||||||
return ssz.HashWithDefaultHasher(b)
|
return ssz.HashWithDefaultHasher(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// HashTreeRootWith ssz hashes the BlobSidecar object with a hasher
|
// HashTreeRootWith ssz hashes the BlobIdentifier object with a hasher
|
||||||
func (b *BlobSidecar) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
func (b *BlobIdentifier) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||||
indx := hh.Index()
|
indx := hh.Index()
|
||||||
|
|
||||||
// Field (0) 'BlockRoot'
|
// Field (0) 'BlockRoot'
|
||||||
@@ -6342,127 +6297,6 @@ func (b *BlobSidecar) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
|||||||
// Field (1) 'Index'
|
// Field (1) 'Index'
|
||||||
hh.PutUint64(b.Index)
|
hh.PutUint64(b.Index)
|
||||||
|
|
||||||
// Field (2) 'Slot'
|
|
||||||
hh.PutUint64(uint64(b.Slot))
|
|
||||||
|
|
||||||
// Field (3) 'BlockParentRoot'
|
|
||||||
if size := len(b.BlockParentRoot); size != 32 {
|
|
||||||
err = ssz.ErrBytesLengthFn("--.BlockParentRoot", size, 32)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
hh.PutBytes(b.BlockParentRoot)
|
|
||||||
|
|
||||||
// Field (4) 'ProposerIndex'
|
|
||||||
hh.PutUint64(uint64(b.ProposerIndex))
|
|
||||||
|
|
||||||
// Field (5) 'Blob'
|
|
||||||
if size := len(b.Blob); size != 131072 {
|
|
||||||
err = ssz.ErrBytesLengthFn("--.Blob", size, 131072)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
hh.PutBytes(b.Blob)
|
|
||||||
|
|
||||||
// Field (6) 'KzgCommitment'
|
|
||||||
if size := len(b.KzgCommitment); size != 48 {
|
|
||||||
err = ssz.ErrBytesLengthFn("--.KzgCommitment", size, 48)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
hh.PutBytes(b.KzgCommitment)
|
|
||||||
|
|
||||||
// Field (7) 'KzgProof'
|
|
||||||
if size := len(b.KzgProof); size != 48 {
|
|
||||||
err = ssz.ErrBytesLengthFn("--.KzgProof", size, 48)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
hh.PutBytes(b.KzgProof)
|
|
||||||
|
|
||||||
if ssz.EnableVectorizedHTR {
|
|
||||||
hh.MerkleizeVectorizedHTR(indx)
|
|
||||||
} else {
|
|
||||||
hh.Merkleize(indx)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalSSZ ssz marshals the SignedBlobSidecar object
|
|
||||||
func (s *SignedBlobSidecar) MarshalSSZ() ([]byte, error) {
|
|
||||||
return ssz.MarshalSSZ(s)
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalSSZTo ssz marshals the SignedBlobSidecar object to a target array
|
|
||||||
func (s *SignedBlobSidecar) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
|
||||||
dst = buf
|
|
||||||
|
|
||||||
// Field (0) 'Message'
|
|
||||||
if s.Message == nil {
|
|
||||||
s.Message = new(BlobSidecar)
|
|
||||||
}
|
|
||||||
if dst, err = s.Message.MarshalSSZTo(dst); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Field (1) 'Signature'
|
|
||||||
if size := len(s.Signature); size != 96 {
|
|
||||||
err = ssz.ErrBytesLengthFn("--.Signature", size, 96)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
dst = append(dst, s.Signature...)
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalSSZ ssz unmarshals the SignedBlobSidecar object
|
|
||||||
func (s *SignedBlobSidecar) UnmarshalSSZ(buf []byte) error {
|
|
||||||
var err error
|
|
||||||
size := uint64(len(buf))
|
|
||||||
if size != 131352 {
|
|
||||||
return ssz.ErrSize
|
|
||||||
}
|
|
||||||
|
|
||||||
// Field (0) 'Message'
|
|
||||||
if s.Message == nil {
|
|
||||||
s.Message = new(BlobSidecar)
|
|
||||||
}
|
|
||||||
if err = s.Message.UnmarshalSSZ(buf[0:131256]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Field (1) 'Signature'
|
|
||||||
if cap(s.Signature) == 0 {
|
|
||||||
s.Signature = make([]byte, 0, len(buf[131256:131352]))
|
|
||||||
}
|
|
||||||
s.Signature = append(s.Signature, buf[131256:131352]...)
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// SizeSSZ returns the ssz encoded size in bytes for the SignedBlobSidecar object
|
|
||||||
func (s *SignedBlobSidecar) SizeSSZ() (size int) {
|
|
||||||
size = 131352
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// HashTreeRoot ssz hashes the SignedBlobSidecar object
|
|
||||||
func (s *SignedBlobSidecar) HashTreeRoot() ([32]byte, error) {
|
|
||||||
return ssz.HashWithDefaultHasher(s)
|
|
||||||
}
|
|
||||||
|
|
||||||
// HashTreeRootWith ssz hashes the SignedBlobSidecar object with a hasher
|
|
||||||
func (s *SignedBlobSidecar) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
|
||||||
indx := hh.Index()
|
|
||||||
|
|
||||||
// Field (0) 'Message'
|
|
||||||
if err = s.Message.HashTreeRootWith(hh); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Field (1) 'Signature'
|
|
||||||
if size := len(s.Signature); size != 96 {
|
|
||||||
err = ssz.ErrBytesLengthFn("--.Signature", size, 96)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
hh.PutBytes(s.Signature)
|
|
||||||
|
|
||||||
if ssz.EnableVectorizedHTR {
|
if ssz.EnableVectorizedHTR {
|
||||||
hh.MerkleizeVectorizedHTR(indx)
|
hh.MerkleizeVectorizedHTR(indx)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -96,100 +96,14 @@ func V1Alpha1SignedBeaconBlockDenebToV2(v1alpha1Block *ethpbalpha.SignedBeaconBl
|
|||||||
return v2Block, nil
|
return v2Block, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// V1Alpha1BlobSidecarsToV2 converts an array of v1alpha1 blinded blob sidecars to its v2 equivalent.
|
// V1Alpha1SignedBeaconBlockContentsDenebToV2 converts a v1alpha1 signed Deneb beacon block to a v2
|
||||||
func V1Alpha1BlobSidecarsToV2(v1alpha1Blobs []*ethpbalpha.DeprecatedBlobSidecar) ([]*ethpbv2.BlobSidecar, error) {
|
|
||||||
v2Blobs := make([]*ethpbv2.BlobSidecar, len(v1alpha1Blobs))
|
|
||||||
for index, v1Blob := range v1alpha1Blobs {
|
|
||||||
marshaledBlob, err := proto.Marshal(v1Blob)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "could not marshal blob sidecar")
|
|
||||||
}
|
|
||||||
v2Blob := ðpbv2.BlobSidecar{}
|
|
||||||
if err := proto.Unmarshal(marshaledBlob, v2Blob); err != nil {
|
|
||||||
return nil, errors.Wrap(err, "could not unmarshal blob sidecar")
|
|
||||||
}
|
|
||||||
v2Blobs[index] = v2Blob
|
|
||||||
}
|
|
||||||
return v2Blobs, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// V1Alpha1SignedBlobsToV2 converts an array of v1alpha1 objects to its v2 SignedBlobSidecar equivalent.
|
|
||||||
func V1Alpha1SignedBlobsToV2(sidecars []*ethpbalpha.SignedBlobSidecar) []*ethpbv2.SignedBlobSidecar {
|
|
||||||
result := make([]*ethpbv2.SignedBlobSidecar, len(sidecars))
|
|
||||||
for i, sc := range sidecars {
|
|
||||||
result[i] = V1Alpha1SignedBlobToV2(sc)
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
// V1Alpha1SignedBlobToV2 converts a v1alpha1 object to its v2 SignedBlobSidecar equivalent.
|
|
||||||
func V1Alpha1SignedBlobToV2(sidecar *ethpbalpha.SignedBlobSidecar) *ethpbv2.SignedBlobSidecar {
|
|
||||||
if sidecar == nil || sidecar.Message == nil {
|
|
||||||
return ðpbv2.SignedBlobSidecar{}
|
|
||||||
}
|
|
||||||
return ðpbv2.SignedBlobSidecar{
|
|
||||||
Message: ðpbv2.BlobSidecar{
|
|
||||||
BlockRoot: bytesutil.SafeCopyBytes(sidecar.Message.BlockRoot),
|
|
||||||
Index: sidecar.Message.Index,
|
|
||||||
Slot: sidecar.Message.Slot,
|
|
||||||
BlockParentRoot: bytesutil.SafeCopyBytes(sidecar.Message.BlockParentRoot),
|
|
||||||
ProposerIndex: sidecar.Message.ProposerIndex,
|
|
||||||
Blob: bytesutil.SafeCopyBytes(sidecar.Message.Blob),
|
|
||||||
KzgCommitment: bytesutil.SafeCopyBytes(sidecar.Message.KzgCommitment),
|
|
||||||
KzgProof: bytesutil.SafeCopyBytes(sidecar.Message.KzgProof),
|
|
||||||
},
|
|
||||||
Signature: bytesutil.SafeCopyBytes(sidecar.Signature),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// V1Alpha1BeaconBlockDenebAndBlobsToV2 converts a v1alpha1 Deneb beacon block and blobs to a v2
|
|
||||||
// Deneb block.
|
// Deneb block.
|
||||||
func V1Alpha1BeaconBlockDenebAndBlobsToV2(v1alpha1Block *ethpbalpha.BeaconBlockAndBlobsDeneb) (*ethpbv2.BeaconBlockContentsDeneb, error) {
|
func V1Alpha1SignedBeaconBlockContentsDenebToV2(v1alpha1Block *ethpbalpha.SignedBeaconBlockContentsDeneb) (*ethpbv2.SignedBeaconBlockContentsDeneb, error) {
|
||||||
v2Block, err := V1Alpha1BeaconBlockDenebToV2(v1alpha1Block.Block)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "could not convert block")
|
|
||||||
}
|
|
||||||
v2Blobs, err := V1Alpha1BlobSidecarsToV2(v1alpha1Block.Blobs)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "could not convert blobs")
|
|
||||||
}
|
|
||||||
return ðpbv2.BeaconBlockContentsDeneb{Block: v2Block, BlobSidecars: v2Blobs}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// V1Alpha1SignedBeaconBlockDenebAndBlobsToV2 converts a signed v1alpha1 Deneb beacon block and blobs to a v2
|
|
||||||
// Deneb block.
|
|
||||||
func V1Alpha1SignedBeaconBlockDenebAndBlobsToV2(v1alpha1Block *ethpbalpha.SignedBeaconBlockAndBlobsDeneb) (*ethpbv2.SignedBeaconBlockContentsDeneb, error) {
|
|
||||||
v2Block, err := V1Alpha1SignedBeaconBlockDenebToV2(v1alpha1Block.Block)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "could not convert block")
|
|
||||||
}
|
|
||||||
v2Blobs := V1Alpha1SignedBlobsToV2(v1alpha1Block.Blobs)
|
|
||||||
return ðpbv2.SignedBeaconBlockContentsDeneb{
|
|
||||||
SignedBlock: v2Block,
|
|
||||||
SignedBlobSidecars: v2Blobs,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// V1Alpha1BeaconBlockBlindedBellatrixToV2Blinded converts a v1alpha1 Blinded Bellatrix beacon block to a v2 Blinded Bellatrix block.
|
|
||||||
func V1Alpha1BeaconBlockBlindedBellatrixToV2Blinded(v1alpha1Block *ethpbalpha.BlindedBeaconBlockBellatrix) (*ethpbv2.BlindedBeaconBlockBellatrix, error) {
|
|
||||||
marshaledBlk, err := proto.Marshal(v1alpha1Block)
|
marshaledBlk, err := proto.Marshal(v1alpha1Block)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "could not marshal block")
|
return nil, errors.Wrap(err, "could not marshal block")
|
||||||
}
|
}
|
||||||
v2Block := ðpbv2.BlindedBeaconBlockBellatrix{}
|
v2Block := ðpbv2.SignedBeaconBlockContentsDeneb{}
|
||||||
if err := proto.Unmarshal(marshaledBlk, v2Block); err != nil {
|
|
||||||
return nil, errors.Wrap(err, "could not unmarshal block")
|
|
||||||
}
|
|
||||||
return v2Block, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// V1Alpha1BeaconBlockBlindedCapellaToV2Blinded converts a v1alpha1 Blinded Capella beacon block to a v2 Blinded Capella block.
|
|
||||||
func V1Alpha1BeaconBlockBlindedCapellaToV2Blinded(v1alpha1Block *ethpbalpha.BlindedBeaconBlockCapella) (*ethpbv2.BlindedBeaconBlockCapella, error) {
|
|
||||||
marshaledBlk, err := proto.Marshal(v1alpha1Block)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "could not marshal block")
|
|
||||||
}
|
|
||||||
v2Block := ðpbv2.BlindedBeaconBlockCapella{}
|
|
||||||
if err := proto.Unmarshal(marshaledBlk, v2Block); err != nil {
|
if err := proto.Unmarshal(marshaledBlk, v2Block); err != nil {
|
||||||
return nil, errors.Wrap(err, "could not unmarshal block")
|
return nil, errors.Wrap(err, "could not unmarshal block")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,17 +158,6 @@ func Test_V1Alpha1BeaconBlockCapellaToV2Blinded(t *testing.T) {
|
|||||||
assert.DeepEqual(t, alphaRoot, v2Root)
|
assert.DeepEqual(t, alphaRoot, v2Root)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_V1Alpha1BlobSidecarsToV2(t *testing.T) {
|
|
||||||
sidecar := util.HydrateBlobSidecar(ðpbalpha.DeprecatedBlobSidecar{})
|
|
||||||
blobs := []*ethpbalpha.DeprecatedBlobSidecar{
|
|
||||||
sidecar,
|
|
||||||
}
|
|
||||||
sidecars, err := V1Alpha1BlobSidecarsToV2(blobs)
|
|
||||||
require.NoError(t, err)
|
|
||||||
require.Equal(t, len(sidecars), len(blobs))
|
|
||||||
assert.DeepEqual(t, sidecars[0].Blob, blobs[0].Blob)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestBeaconStateAltairToProto(t *testing.T) {
|
func TestBeaconStateAltairToProto(t *testing.T) {
|
||||||
source, err := util.NewBeaconStateAltair(util.FillRootsNaturalOptAltair, func(state *ethpbalpha.BeaconStateAltair) error {
|
source, err := util.NewBeaconStateAltair(util.FillRootsNaturalOptAltair, func(state *ethpbalpha.BeaconStateAltair) error {
|
||||||
state.GenesisTime = 1
|
state.GenesisTime = 1
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package migration
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
|
|
||||||
ethpbv2 "github.com/prysmaticlabs/prysm/v4/proto/eth/v2"
|
ethpbv2 "github.com/prysmaticlabs/prysm/v4/proto/eth/v2"
|
||||||
ethpbalpha "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
ethpbalpha "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
@@ -112,34 +111,3 @@ func BlindedDenebToV1Alpha1SignedBlock(denebBlk *ethpbv2.SignedBlindedBeaconBloc
|
|||||||
}
|
}
|
||||||
return v1alpha1Block, nil
|
return v1alpha1Block, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SignedBlobsToV1Alpha1SignedBlobs converts an array of v2 SignedBlobSidecar objects to its v1alpha1 equivalent.
|
|
||||||
func SignedBlobsToV1Alpha1SignedBlobs(sidecars []*ethpbv2.SignedBlobSidecar) []*ethpbalpha.SignedBlobSidecar {
|
|
||||||
result := make([]*ethpbalpha.SignedBlobSidecar, len(sidecars))
|
|
||||||
for i, sc := range sidecars {
|
|
||||||
result[i] = ðpbalpha.SignedBlobSidecar{
|
|
||||||
Message: ðpbalpha.DeprecatedBlobSidecar{
|
|
||||||
BlockRoot: bytesutil.SafeCopyBytes(sc.Message.BlockRoot),
|
|
||||||
Index: sc.Message.Index,
|
|
||||||
Slot: sc.Message.Slot,
|
|
||||||
BlockParentRoot: bytesutil.SafeCopyBytes(sc.Message.BlockParentRoot),
|
|
||||||
ProposerIndex: sc.Message.ProposerIndex,
|
|
||||||
Blob: bytesutil.SafeCopyBytes(sc.Message.Blob),
|
|
||||||
KzgCommitment: bytesutil.SafeCopyBytes(sc.Message.KzgCommitment),
|
|
||||||
KzgProof: bytesutil.SafeCopyBytes(sc.Message.KzgProof),
|
|
||||||
},
|
|
||||||
Signature: bytesutil.SafeCopyBytes(sc.Signature),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
// DenebBlockContentsToV1Alpha1 converts signed deneb block contents to signed beacon block and blobs deneb
|
|
||||||
func DenebBlockContentsToV1Alpha1(blockcontents *ethpbv2.SignedBeaconBlockContentsDeneb) (*ethpbalpha.SignedBeaconBlockAndBlobsDeneb, error) {
|
|
||||||
block, err := DenebToV1Alpha1SignedBlock(blockcontents.SignedBlock)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrap(err, "could not convert block")
|
|
||||||
}
|
|
||||||
blobs := SignedBlobsToV1Alpha1SignedBlobs(blockcontents.SignedBlobSidecars)
|
|
||||||
return ðpbalpha.SignedBeaconBlockAndBlobsDeneb{Block: block, Blobs: blobs}, nil
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -70,12 +70,10 @@ ssz_gen_marshal(
|
|||||||
"BlindedBeaconBlockCapella",
|
"BlindedBeaconBlockCapella",
|
||||||
"BlindedBeaconBlockBodyCapella",
|
"BlindedBeaconBlockBodyCapella",
|
||||||
"SignedBlindedBeaconBlockDeneb",
|
"SignedBlindedBeaconBlockDeneb",
|
||||||
"BeaconBlockAndBlobsDeneb",
|
"BeaconBlockContentsDeneb",
|
||||||
"SignedBeaconBlockAndBlobsDeneb",
|
"SignedBeaconBlockContentsDeneb",
|
||||||
"BlindedBeaconBlockDeneb",
|
"BlindedBeaconBlockDeneb",
|
||||||
"BlindedBeaconBlockBodyDeneb",
|
"BlindedBeaconBlockBodyDeneb",
|
||||||
"SignedBlindedBeaconBlockAndBlobsDeneb",
|
|
||||||
"BlindedBeaconBlockAndBlobsDeneb",
|
|
||||||
"SyncAggregate",
|
"SyncAggregate",
|
||||||
"SyncCommitteeMessage",
|
"SyncCommitteeMessage",
|
||||||
"SyncCommitteeContribution",
|
"SyncCommitteeContribution",
|
||||||
@@ -130,6 +128,7 @@ ssz_gen_marshal(
|
|||||||
"BuilderBidDeneb",
|
"BuilderBidDeneb",
|
||||||
"DeprecatedBlobSidecar",
|
"DeprecatedBlobSidecar",
|
||||||
"BlobSidecar",
|
"BlobSidecar",
|
||||||
|
"BlobSidecars",
|
||||||
"SignedBlobSidecar",
|
"SignedBlobSidecar",
|
||||||
"BlobIdentifier",
|
"BlobIdentifier",
|
||||||
],
|
],
|
||||||
|
|||||||
2550
proto/prysm/v1alpha1/beacon_block.pb.go
generated
2550
proto/prysm/v1alpha1/beacon_block.pb.go
generated
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,6 @@ package ethereum.eth.v1alpha1;
|
|||||||
|
|
||||||
import "proto/eth/ext/options.proto";
|
import "proto/eth/ext/options.proto";
|
||||||
import "proto/prysm/v1alpha1/attestation.proto";
|
import "proto/prysm/v1alpha1/attestation.proto";
|
||||||
import "proto/prysm/v1alpha1/blobs.proto";
|
|
||||||
import "proto/prysm/v1alpha1/withdrawals.proto";
|
import "proto/prysm/v1alpha1/withdrawals.proto";
|
||||||
import "proto/engine/v1/execution_engine.proto";
|
import "proto/engine/v1/execution_engine.proto";
|
||||||
|
|
||||||
@@ -49,10 +48,9 @@ message GenericSignedBeaconBlock {
|
|||||||
SignedBlindedBeaconBlockCapella blinded_capella = 6;
|
SignedBlindedBeaconBlockCapella blinded_capella = 6;
|
||||||
|
|
||||||
// Representing a signed, post-Deneb fork beacon block content.
|
// Representing a signed, post-Deneb fork beacon block content.
|
||||||
SignedBeaconBlockDeneb deneb = 7;
|
SignedBeaconBlockContentsDeneb deneb = 7;
|
||||||
|
|
||||||
// Representing a signed, post-Deneb fork blinded beacon block content.
|
SignedBlindedBeaconBlockDeneb blinded_deneb = 8;
|
||||||
SignedBlindedBeaconBlockAndBlobsDeneb blinded_deneb = 8;
|
|
||||||
}
|
}
|
||||||
bool is_blinded = 100;
|
bool is_blinded = 100;
|
||||||
uint64 payload_value = 101;
|
uint64 payload_value = 101;
|
||||||
@@ -79,10 +77,9 @@ message GenericBeaconBlock {
|
|||||||
BlindedBeaconBlockCapella blinded_capella = 6;
|
BlindedBeaconBlockCapella blinded_capella = 6;
|
||||||
|
|
||||||
// Representing a signed, post-Deneb fork beacon block content.
|
// Representing a signed, post-Deneb fork beacon block content.
|
||||||
BeaconBlockDeneb deneb = 7;
|
BeaconBlockContentsDeneb deneb = 7;
|
||||||
|
|
||||||
// Representing a signed, post-Deneb fork blinded beacon block content.
|
BlindedBeaconBlockDeneb blinded_deneb = 8;
|
||||||
BlindedBeaconBlockAndBlobsDeneb blinded_deneb = 8;
|
|
||||||
}
|
}
|
||||||
bool is_blinded = 100;
|
bool is_blinded = 100;
|
||||||
uint64 payload_value = 101;
|
uint64 payload_value = 101;
|
||||||
@@ -453,9 +450,16 @@ message BlindedBeaconBlockBodyBellatrix {
|
|||||||
ethereum.engine.v1.ExecutionPayloadHeader execution_payload_header = 10;
|
ethereum.engine.v1.ExecutionPayloadHeader execution_payload_header = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SignedBeaconBlockAndBlobsDeneb {
|
message SignedBeaconBlockContentsDeneb {
|
||||||
SignedBeaconBlockDeneb block = 1;
|
SignedBeaconBlockDeneb block = 1;
|
||||||
repeated SignedBlobSidecar blobs = 2 [(ethereum.eth.ext.ssz_max) = "max_blobs_per_block.size"];
|
repeated bytes kzg_proofs = 2 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "4096"];
|
||||||
|
repeated bytes blobs = 3 [(ethereum.eth.ext.ssz_size) = "?,blob.size", (ethereum.eth.ext.ssz_max) = "4096"];
|
||||||
|
}
|
||||||
|
|
||||||
|
message BeaconBlockContentsDeneb {
|
||||||
|
BeaconBlockDeneb block = 1;
|
||||||
|
repeated bytes kzg_proofs = 2 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "4096"];
|
||||||
|
repeated bytes blobs = 3 [(ethereum.eth.ext.ssz_size) = "?,blob.size", (ethereum.eth.ext.ssz_max) = "4096"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message SignedBeaconBlockDeneb {
|
message SignedBeaconBlockDeneb {
|
||||||
@@ -466,11 +470,6 @@ message SignedBeaconBlockDeneb {
|
|||||||
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
|
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message BeaconBlockAndBlobsDeneb {
|
|
||||||
BeaconBlockDeneb block = 1;
|
|
||||||
repeated DeprecatedBlobSidecar blobs = 2 [(ethereum.eth.ext.ssz_max) = "max_blobs_per_block.size"];
|
|
||||||
}
|
|
||||||
|
|
||||||
message BeaconBlockDeneb {
|
message BeaconBlockDeneb {
|
||||||
// Beacon chain slot that this block represents.
|
// Beacon chain slot that this block represents.
|
||||||
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
||||||
@@ -654,16 +653,6 @@ message BlindedBeaconBlockBodyCapella {
|
|||||||
repeated SignedBLSToExecutionChange bls_to_execution_changes = 11 [(ethereum.eth.ext.ssz_max) = "16"];
|
repeated SignedBLSToExecutionChange bls_to_execution_changes = 11 [(ethereum.eth.ext.ssz_max) = "16"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message SignedBlindedBeaconBlockAndBlobsDeneb {
|
|
||||||
SignedBlindedBeaconBlockDeneb signed_blinded_block = 1;
|
|
||||||
repeated SignedBlindedBlobSidecar signed_blinded_blob_sidecars = 2 [(ethereum.eth.ext.ssz_max) = "max_blobs_per_block.size"];
|
|
||||||
}
|
|
||||||
|
|
||||||
message BlindedBeaconBlockAndBlobsDeneb {
|
|
||||||
BlindedBeaconBlockDeneb block = 1;
|
|
||||||
repeated BlindedBlobSidecar blobs = 2 [(ethereum.eth.ext.ssz_max) = "max_blobs_per_block.size"];
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignedBlindedBeaconBlockDeneb {
|
message SignedBlindedBeaconBlockDeneb {
|
||||||
// The unsigned blinded beacon block itself.
|
// The unsigned blinded beacon block itself.
|
||||||
BlindedBeaconBlockDeneb message = 1;
|
BlindedBeaconBlockDeneb message = 1;
|
||||||
@@ -785,3 +774,7 @@ message BlobSidecar {
|
|||||||
SignedBeaconBlockHeader signed_block_header = 5;
|
SignedBeaconBlockHeader signed_block_header = 5;
|
||||||
repeated bytes commitment_inclusion_proof = 6 [(ethereum.eth.ext.ssz_size) = "kzg_commitment_inclusion_proof_depth.size,32"];
|
repeated bytes commitment_inclusion_proof = 6 [(ethereum.eth.ext.ssz_size) = "kzg_commitment_inclusion_proof_depth.size,32"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message BlobSidecars {
|
||||||
|
repeated BlobSidecar sidecars = 1 [(ethereum.eth.ext.ssz_max) = "max_blobs_per_block.size"];
|
||||||
|
}
|
||||||
226
proto/prysm/v1alpha1/blobs.pb.go
generated
226
proto/prysm/v1alpha1/blobs.pb.go
generated
@@ -23,7 +23,7 @@ const (
|
|||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
)
|
)
|
||||||
|
|
||||||
type BlobSidecars struct {
|
type DeprecatedBlobSidecars struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
@@ -31,8 +31,8 @@ type BlobSidecars struct {
|
|||||||
Sidecars []*DeprecatedBlobSidecar `protobuf:"bytes,1,rep,name=sidecars,proto3" json:"sidecars,omitempty"`
|
Sidecars []*DeprecatedBlobSidecar `protobuf:"bytes,1,rep,name=sidecars,proto3" json:"sidecars,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *BlobSidecars) Reset() {
|
func (x *DeprecatedBlobSidecars) Reset() {
|
||||||
*x = BlobSidecars{}
|
*x = DeprecatedBlobSidecars{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_proto_prysm_v1alpha1_blobs_proto_msgTypes[0]
|
mi := &file_proto_prysm_v1alpha1_blobs_proto_msgTypes[0]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
@@ -40,13 +40,13 @@ func (x *BlobSidecars) Reset() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *BlobSidecars) String() string {
|
func (x *DeprecatedBlobSidecars) String() string {
|
||||||
return protoimpl.X.MessageStringOf(x)
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*BlobSidecars) ProtoMessage() {}
|
func (*DeprecatedBlobSidecars) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *BlobSidecars) ProtoReflect() protoreflect.Message {
|
func (x *DeprecatedBlobSidecars) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_proto_prysm_v1alpha1_blobs_proto_msgTypes[0]
|
mi := &file_proto_prysm_v1alpha1_blobs_proto_msgTypes[0]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
@@ -58,12 +58,12 @@ func (x *BlobSidecars) ProtoReflect() protoreflect.Message {
|
|||||||
return mi.MessageOf(x)
|
return mi.MessageOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Use BlobSidecars.ProtoReflect.Descriptor instead.
|
// Deprecated: Use DeprecatedBlobSidecars.ProtoReflect.Descriptor instead.
|
||||||
func (*BlobSidecars) Descriptor() ([]byte, []int) {
|
func (*DeprecatedBlobSidecars) Descriptor() ([]byte, []int) {
|
||||||
return file_proto_prysm_v1alpha1_blobs_proto_rawDescGZIP(), []int{0}
|
return file_proto_prysm_v1alpha1_blobs_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *BlobSidecars) GetSidecars() []*DeprecatedBlobSidecar {
|
func (x *DeprecatedBlobSidecars) GetSidecars() []*DeprecatedBlobSidecar {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Sidecars
|
return x.Sidecars
|
||||||
}
|
}
|
||||||
@@ -496,109 +496,109 @@ var file_proto_prysm_v1alpha1_blobs_proto_rawDesc = []byte{
|
|||||||
0x74, 0x6f, 0x12, 0x15, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68,
|
0x74, 0x6f, 0x12, 0x15, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68,
|
||||||
0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x58, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69,
|
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x62, 0x0a, 0x16, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63,
|
||||||
0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x12, 0x48, 0x0a, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61,
|
0x61, 0x74, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73,
|
||||||
0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72,
|
0x12, 0x48, 0x0a, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03,
|
||||||
0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
|
0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74,
|
||||||
0x2e, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53,
|
0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x72, 0x65,
|
||||||
0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x52, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73,
|
0x63, 0x61, 0x74, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72,
|
||||||
0x22, 0xcf, 0x03, 0x0a, 0x15, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x42,
|
0x52, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x22, 0xcf, 0x03, 0x0a, 0x15, 0x44,
|
||||||
0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c,
|
0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64,
|
||||||
0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06,
|
0x65, 0x63, 0x61, 0x72, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f,
|
||||||
0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f,
|
0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32,
|
||||||
0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04,
|
0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69,
|
||||||
0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18,
|
0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65,
|
||||||
0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75,
|
0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42,
|
||||||
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c,
|
0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||||
0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e,
|
0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72,
|
||||||
0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69,
|
0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73,
|
||||||
0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c,
|
0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65,
|
||||||
0x6f, 0x74, 0x12, 0x32, 0x0a, 0x11, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x70, 0x61, 0x72, 0x65,
|
0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x32, 0x0a, 0x11,
|
||||||
0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a,
|
0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f,
|
||||||
0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x65,
|
0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52,
|
||||||
0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73,
|
0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74,
|
||||||
0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f,
|
0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64,
|
||||||
0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70,
|
0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69,
|
||||||
0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79,
|
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74,
|
||||||
0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d,
|
0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f,
|
||||||
0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73,
|
0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f,
|
||||||
0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52,
|
0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64,
|
||||||
0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e,
|
0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f,
|
||||||
0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5,
|
0x73, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62,
|
||||||
0x18, 0x06, 0x31, 0x33, 0x31, 0x30, 0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x2d,
|
0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0x8a, 0xb5, 0x18, 0x06, 0x31, 0x33, 0x31, 0x30,
|
||||||
0x0a, 0x0e, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74,
|
0x37, 0x32, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x2d, 0x0a, 0x0e, 0x6b, 0x7a, 0x67, 0x5f,
|
||||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0d,
|
0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c,
|
||||||
0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a,
|
0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x0d, 0x6b, 0x7a, 0x67, 0x43, 0x6f, 0x6d,
|
||||||
0x09, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c,
|
0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x09, 0x6b, 0x7a, 0x67, 0x5f, 0x70,
|
||||||
0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f,
|
0x72, 0x6f, 0x6f, 0x66, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02,
|
||||||
0x6f, 0x66, 0x22, 0x81, 0x01, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f,
|
0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x81, 0x01, 0x0a,
|
||||||
0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x46, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73,
|
0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63,
|
||||||
0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65,
|
0x61, 0x72, 0x12, 0x46, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20,
|
||||||
|
0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65,
|
||||||
|
0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x72,
|
||||||
|
0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61,
|
||||||
|
0x72, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69,
|
||||||
|
0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a,
|
||||||
|
0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65,
|
||||||
|
0x22, 0x63, 0x0a, 0x13, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53,
|
||||||
|
0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63,
|
||||||
|
0x61, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65,
|
||||||
0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61,
|
0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61,
|
||||||
0x31, 0x2e, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x62,
|
0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64,
|
||||||
0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
0x65, 0x63, 0x61, 0x72, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01, 0x36, 0x52, 0x08, 0x73, 0x69, 0x64,
|
||||||
0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20,
|
0x65, 0x63, 0x61, 0x72, 0x73, 0x22, 0xd1, 0x03, 0x0a, 0x12, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65,
|
||||||
0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67,
|
0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x25, 0x0a, 0x0a,
|
||||||
0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x63, 0x0a, 0x13, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65,
|
0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c,
|
||||||
0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x12, 0x4c, 0x0a,
|
0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52,
|
||||||
0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
0x6f, 0x6f, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76,
|
0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f,
|
||||||
0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42,
|
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67, 0x69, 0x74,
|
||||||
0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x42, 0x05, 0x92, 0xb5, 0x18, 0x01,
|
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69,
|
||||||
0x36, 0x52, 0x08, 0x73, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x73, 0x22, 0xd1, 0x03, 0x0a, 0x12,
|
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, 0x32, 0x0a, 0x11, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x70, 0x61,
|
||||||
|
0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42,
|
||||||
|
0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61,
|
||||||
|
0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x76, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70,
|
||||||
|
0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 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, 0x23, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06, 0x20,
|
||||||
|
0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x08, 0x62, 0x6c, 0x6f,
|
||||||
|
0x62, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2d, 0x0a, 0x0e, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d,
|
||||||
|
0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x07, 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, 0x12, 0x23, 0x0a, 0x09, 0x6b, 0x7a, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f,
|
||||||
|
0x66, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x34, 0x38, 0x52,
|
||||||
|
0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x85, 0x01, 0x0a, 0x18, 0x53, 0x69,
|
||||||
|
0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53,
|
||||||
|
0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x43, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||||
|
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65,
|
||||||
|
0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e,
|
||||||
0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63,
|
0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 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,
|
0x61, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73,
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09,
|
0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06,
|
||||||
0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64,
|
0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72,
|
||||||
0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12,
|
0x65, 0x22, 0x4d, 0x0a, 0x0e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66,
|
||||||
0x59, 0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82,
|
0x69, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f,
|
||||||
0xb5, 0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72,
|
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52,
|
||||||
0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73,
|
0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e,
|
||||||
0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74,
|
0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78,
|
||||||
0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e,
|
0x42, 0x95, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
|
||||||
0x53, 0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x32, 0x0a, 0x11, 0x62, 0x6c,
|
0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0a,
|
||||||
0x6f, 0x63, 0x6b, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18,
|
0x42, 0x6c, 0x6f, 0x62, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69,
|
||||||
0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62,
|
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74,
|
||||||
0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x76,
|
0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f,
|
||||||
0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78,
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c,
|
||||||
0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68,
|
0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72,
|
||||||
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63,
|
0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
|
||||||
0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f,
|
0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c,
|
||||||
0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72,
|
0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
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, 0x23, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x72,
|
|
||||||
0x6f, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33,
|
|
||||||
0x32, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2d, 0x0a, 0x0e, 0x6b,
|
|
||||||
0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x07, 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, 0x12, 0x23, 0x0a, 0x09, 0x6b, 0x7a,
|
|
||||||
0x67, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a,
|
|
||||||
0xb5, 0x18, 0x02, 0x34, 0x38, 0x52, 0x08, 0x6b, 0x7a, 0x67, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22,
|
|
||||||
0x85, 0x01, 0x0a, 0x18, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65,
|
|
||||||
0x64, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x12, 0x43, 0x0a, 0x07,
|
|
||||||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e,
|
|
||||||
0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61,
|
|
||||||
0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f,
|
|
||||||
0x62, 0x53, 0x69, 0x64, 0x65, 0x63, 0x61, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
|
||||||
0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02,
|
|
||||||
0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69,
|
|
||||||
0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x4d, 0x0a, 0x0e, 0x42, 0x6c, 0x6f, 0x62, 0x49,
|
|
||||||
0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 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, 0x42, 0x95, 0x01, 0x0a, 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65,
|
|
||||||
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c,
|
|
||||||
0x70, 0x68, 0x61, 0x31, 0x42, 0x0a, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f,
|
|
||||||
0x50, 0x01, 0x5a, 0x3a, 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, 0x70, 0x72, 0x79, 0x73,
|
|
||||||
0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02,
|
|
||||||
0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31,
|
|
||||||
0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
|
|
||||||
0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06,
|
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -615,7 +615,7 @@ func file_proto_prysm_v1alpha1_blobs_proto_rawDescGZIP() []byte {
|
|||||||
|
|
||||||
var file_proto_prysm_v1alpha1_blobs_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
var file_proto_prysm_v1alpha1_blobs_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||||
var file_proto_prysm_v1alpha1_blobs_proto_goTypes = []interface{}{
|
var file_proto_prysm_v1alpha1_blobs_proto_goTypes = []interface{}{
|
||||||
(*BlobSidecars)(nil), // 0: ethereum.eth.v1alpha1.BlobSidecars
|
(*DeprecatedBlobSidecars)(nil), // 0: ethereum.eth.v1alpha1.DeprecatedBlobSidecars
|
||||||
(*DeprecatedBlobSidecar)(nil), // 1: ethereum.eth.v1alpha1.DeprecatedBlobSidecar
|
(*DeprecatedBlobSidecar)(nil), // 1: ethereum.eth.v1alpha1.DeprecatedBlobSidecar
|
||||||
(*SignedBlobSidecar)(nil), // 2: ethereum.eth.v1alpha1.SignedBlobSidecar
|
(*SignedBlobSidecar)(nil), // 2: ethereum.eth.v1alpha1.SignedBlobSidecar
|
||||||
(*BlindedBlobSidecars)(nil), // 3: ethereum.eth.v1alpha1.BlindedBlobSidecars
|
(*BlindedBlobSidecars)(nil), // 3: ethereum.eth.v1alpha1.BlindedBlobSidecars
|
||||||
@@ -624,7 +624,7 @@ var file_proto_prysm_v1alpha1_blobs_proto_goTypes = []interface{}{
|
|||||||
(*BlobIdentifier)(nil), // 6: ethereum.eth.v1alpha1.BlobIdentifier
|
(*BlobIdentifier)(nil), // 6: ethereum.eth.v1alpha1.BlobIdentifier
|
||||||
}
|
}
|
||||||
var file_proto_prysm_v1alpha1_blobs_proto_depIdxs = []int32{
|
var file_proto_prysm_v1alpha1_blobs_proto_depIdxs = []int32{
|
||||||
1, // 0: ethereum.eth.v1alpha1.BlobSidecars.sidecars:type_name -> ethereum.eth.v1alpha1.DeprecatedBlobSidecar
|
1, // 0: ethereum.eth.v1alpha1.DeprecatedBlobSidecars.sidecars:type_name -> ethereum.eth.v1alpha1.DeprecatedBlobSidecar
|
||||||
1, // 1: ethereum.eth.v1alpha1.SignedBlobSidecar.message:type_name -> ethereum.eth.v1alpha1.DeprecatedBlobSidecar
|
1, // 1: ethereum.eth.v1alpha1.SignedBlobSidecar.message:type_name -> ethereum.eth.v1alpha1.DeprecatedBlobSidecar
|
||||||
4, // 2: ethereum.eth.v1alpha1.BlindedBlobSidecars.sidecars:type_name -> ethereum.eth.v1alpha1.BlindedBlobSidecar
|
4, // 2: ethereum.eth.v1alpha1.BlindedBlobSidecars.sidecars:type_name -> ethereum.eth.v1alpha1.BlindedBlobSidecar
|
||||||
4, // 3: ethereum.eth.v1alpha1.SignedBlindedBlobSidecar.message:type_name -> ethereum.eth.v1alpha1.BlindedBlobSidecar
|
4, // 3: ethereum.eth.v1alpha1.SignedBlindedBlobSidecar.message:type_name -> ethereum.eth.v1alpha1.BlindedBlobSidecar
|
||||||
@@ -642,7 +642,7 @@ func file_proto_prysm_v1alpha1_blobs_proto_init() {
|
|||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_proto_prysm_v1alpha1_blobs_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_proto_prysm_v1alpha1_blobs_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*BlobSidecars); i {
|
switch v := v.(*DeprecatedBlobSidecars); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
|
|||||||
@@ -24,47 +24,47 @@ option java_outer_classname = "BlobsProto";
|
|||||||
option java_package = "org.ethereum.eth.v1alpha1";
|
option java_package = "org.ethereum.eth.v1alpha1";
|
||||||
option php_namespace = "Ethereum\\Eth\\v1alpha1";
|
option php_namespace = "Ethereum\\Eth\\v1alpha1";
|
||||||
|
|
||||||
message BlobSidecars {
|
message DeprecatedBlobSidecars {
|
||||||
repeated DeprecatedBlobSidecar sidecars = 1;
|
repeated DeprecatedBlobSidecar sidecars = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message DeprecatedBlobSidecar {
|
message DeprecatedBlobSidecar {
|
||||||
bytes block_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
bytes block_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||||
uint64 index = 2;
|
uint64 index = 2;
|
||||||
uint64 slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
uint64 slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
||||||
bytes block_parent_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
|
bytes block_parent_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||||
uint64 proposer_index = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"];
|
uint64 proposer_index = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"];
|
||||||
bytes blob = 6 [(ethereum.eth.ext.ssz_size) = "blob.size"];
|
bytes blob = 6 [(ethereum.eth.ext.ssz_size) = "blob.size"];
|
||||||
bytes kzg_commitment = 7 [(ethereum.eth.ext.ssz_size) = "48"];
|
bytes kzg_commitment = 7 [(ethereum.eth.ext.ssz_size) = "48"];
|
||||||
bytes kzg_proof = 8 [(ethereum.eth.ext.ssz_size) = "48"];
|
bytes kzg_proof = 8 [(ethereum.eth.ext.ssz_size) = "48"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message SignedBlobSidecar {
|
message SignedBlobSidecar {
|
||||||
DeprecatedBlobSidecar message = 1;
|
DeprecatedBlobSidecar message = 1;
|
||||||
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
|
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message BlindedBlobSidecars {
|
message BlindedBlobSidecars {
|
||||||
repeated BlindedBlobSidecar sidecars = 1 [(ethereum.eth.ext.ssz_max) = "max_blobs_per_block.size"];
|
repeated BlindedBlobSidecar sidecars = 1 [(ethereum.eth.ext.ssz_max) = "max_blobs_per_block.size"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message BlindedBlobSidecar {
|
message BlindedBlobSidecar {
|
||||||
bytes block_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
bytes block_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||||
uint64 index = 2;
|
uint64 index = 2;
|
||||||
uint64 slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
uint64 slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
||||||
bytes block_parent_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
|
bytes block_parent_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||||
uint64 proposer_index = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"];
|
uint64 proposer_index = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"];
|
||||||
bytes blob_root = 6 [(ethereum.eth.ext.ssz_size) = "32"];
|
bytes blob_root = 6 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||||
bytes kzg_commitment = 7 [(ethereum.eth.ext.ssz_size) = "48"];
|
bytes kzg_commitment = 7 [(ethereum.eth.ext.ssz_size) = "48"];
|
||||||
bytes kzg_proof = 8 [(ethereum.eth.ext.ssz_size) = "48"];
|
bytes kzg_proof = 8 [(ethereum.eth.ext.ssz_size) = "48"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message SignedBlindedBlobSidecar {
|
message SignedBlindedBlobSidecar {
|
||||||
BlindedBlobSidecar message = 1;
|
BlindedBlobSidecar message = 1;
|
||||||
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
|
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message BlobIdentifier {
|
message BlobIdentifier {
|
||||||
bytes block_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
bytes block_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
||||||
uint64 index = 2;
|
uint64 index = 2;
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1139,6 +1139,9 @@ func SaveBlock(tb assertions.AssertionTestingTB, ctx context.Context, db iface.N
|
|||||||
// HydrateSignedBeaconBlockDeneb hydrates a signed beacon block with correct field length sizes
|
// HydrateSignedBeaconBlockDeneb hydrates a signed beacon block with correct field length sizes
|
||||||
// to comply with fssz marshalling and unmarshalling rules.
|
// to comply with fssz marshalling and unmarshalling rules.
|
||||||
func HydrateSignedBeaconBlockDeneb(b *ethpb.SignedBeaconBlockDeneb) *ethpb.SignedBeaconBlockDeneb {
|
func HydrateSignedBeaconBlockDeneb(b *ethpb.SignedBeaconBlockDeneb) *ethpb.SignedBeaconBlockDeneb {
|
||||||
|
if b == nil {
|
||||||
|
b = ðpb.SignedBeaconBlockDeneb{}
|
||||||
|
}
|
||||||
if b.Signature == nil {
|
if b.Signature == nil {
|
||||||
b.Signature = make([]byte, fieldparams.BLSSignatureLength)
|
b.Signature = make([]byte, fieldparams.BLSSignatureLength)
|
||||||
}
|
}
|
||||||
@@ -1146,6 +1149,13 @@ func HydrateSignedBeaconBlockDeneb(b *ethpb.SignedBeaconBlockDeneb) *ethpb.Signe
|
|||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HydrateSignedBeaconBlockContentsDeneb hydrates a signed beacon block with correct field length sizes
|
||||||
|
// to comply with fssz marshalling and unmarshalling rules.
|
||||||
|
func HydrateSignedBeaconBlockContentsDeneb(b *ethpb.SignedBeaconBlockContentsDeneb) *ethpb.SignedBeaconBlockContentsDeneb {
|
||||||
|
b.Block = HydrateSignedBeaconBlockDeneb(b.Block)
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
// HydrateV2SignedBeaconBlockDeneb hydrates a v2 signed beacon block with correct field length sizes
|
// HydrateV2SignedBeaconBlockDeneb hydrates a v2 signed beacon block with correct field length sizes
|
||||||
// to comply with fssz marshalling and unmarshalling rules.
|
// to comply with fssz marshalling and unmarshalling rules.
|
||||||
func HydrateV2SignedBeaconBlockDeneb(b *v2.SignedBeaconBlockDeneb) *v2.SignedBeaconBlockDeneb {
|
func HydrateV2SignedBeaconBlockDeneb(b *v2.SignedBeaconBlockDeneb) *v2.SignedBeaconBlockDeneb {
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package util
|
package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
|
|
||||||
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
|
|
||||||
v2 "github.com/prysmaticlabs/prysm/v4/proto/eth/v2"
|
v2 "github.com/prysmaticlabs/prysm/v4/proto/eth/v2"
|
||||||
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
||||||
)
|
)
|
||||||
@@ -38,44 +35,17 @@ func NewBeaconBlockDeneb() *ethpb.SignedBeaconBlockDeneb {
|
|||||||
return HydrateSignedBeaconBlockDeneb(ðpb.SignedBeaconBlockDeneb{})
|
return HydrateSignedBeaconBlockDeneb(ðpb.SignedBeaconBlockDeneb{})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewBeaconBlockContentsDeneb creates a beacon block with minimum marshalable fields.
|
||||||
|
func NewBeaconBlockContentsDeneb() *ethpb.SignedBeaconBlockContentsDeneb {
|
||||||
|
return HydrateSignedBeaconBlockContentsDeneb(ðpb.SignedBeaconBlockContentsDeneb{})
|
||||||
|
}
|
||||||
|
|
||||||
// NewBlindedBeaconBlockDeneb creates a blinded beacon block with minimum marshalable fields.
|
// NewBlindedBeaconBlockDeneb creates a blinded beacon block with minimum marshalable fields.
|
||||||
func NewBlindedBeaconBlockDeneb() *ethpb.SignedBlindedBeaconBlockDeneb {
|
func NewBlindedBeaconBlockDeneb() *ethpb.SignedBlindedBeaconBlockDeneb {
|
||||||
return HydrateSignedBlindedBeaconBlockDeneb(ðpb.SignedBlindedBeaconBlockDeneb{})
|
return HydrateSignedBlindedBeaconBlockDeneb(ðpb.SignedBlindedBeaconBlockDeneb{})
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBlindedBlobSidecar creates a signed blinded blob sidecar with minimum marshalable fields.
|
|
||||||
func NewBlindedBlobSidecar() *ethpb.SignedBlindedBlobSidecar {
|
|
||||||
return HydrateSignedBlindedBlobSidecar(ðpb.SignedBlindedBlobSidecar{})
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewBlindedBeaconBlockCapellaV2 creates a blinded beacon block with minimum marshalable fields.
|
// NewBlindedBeaconBlockCapellaV2 creates a blinded beacon block with minimum marshalable fields.
|
||||||
func NewBlindedBeaconBlockCapellaV2() *v2.SignedBlindedBeaconBlockCapella {
|
func NewBlindedBeaconBlockCapellaV2() *v2.SignedBlindedBeaconBlockCapella {
|
||||||
return HydrateV2SignedBlindedBeaconBlockCapella(&v2.SignedBlindedBeaconBlockCapella{})
|
return HydrateV2SignedBlindedBeaconBlockCapella(&v2.SignedBlindedBeaconBlockCapella{})
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBeaconBlockContentsDeneb creates a beacon block content including blobs with minimum marshalable fields.
|
|
||||||
func NewBeaconBlockContentsDeneb(numOfBlobs uint64) (*v2.SignedBeaconBlockContentsDeneb, error) {
|
|
||||||
if numOfBlobs > fieldparams.MaxBlobsPerBlock {
|
|
||||||
return nil, fmt.Errorf("declared too many blobs: %v", numOfBlobs)
|
|
||||||
}
|
|
||||||
blobs := make([]*v2.SignedBlobSidecar, numOfBlobs)
|
|
||||||
for i := range blobs {
|
|
||||||
blobs[i] = &v2.SignedBlobSidecar{
|
|
||||||
Message: &v2.BlobSidecar{
|
|
||||||
BlockRoot: make([]byte, fieldparams.RootLength),
|
|
||||||
Index: 0,
|
|
||||||
Slot: 0,
|
|
||||||
BlockParentRoot: make([]byte, fieldparams.RootLength),
|
|
||||||
ProposerIndex: 0,
|
|
||||||
Blob: make([]byte, fieldparams.BlobLength),
|
|
||||||
KzgCommitment: make([]byte, fieldparams.BLSPubkeyLength),
|
|
||||||
KzgProof: make([]byte, fieldparams.BLSPubkeyLength),
|
|
||||||
},
|
|
||||||
Signature: make([]byte, fieldparams.BLSSignatureLength),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return &v2.SignedBeaconBlockContentsDeneb{
|
|
||||||
SignedBlock: HydrateV2SignedBeaconBlockDeneb(&v2.SignedBeaconBlockDeneb{}),
|
|
||||||
SignedBlobSidecars: blobs,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -137,11 +137,11 @@ func (c beaconApiValidatorClient) getBeaconBlock(ctx context.Context, slot primi
|
|||||||
}
|
}
|
||||||
case version.String(version.Deneb):
|
case version.String(version.Deneb):
|
||||||
if blinded {
|
if blinded {
|
||||||
jsonDenebBlockContents := shared.BlindedBeaconBlockContentsDeneb{}
|
jsonDenebBlock := shared.BlindedBeaconBlockDeneb{}
|
||||||
if err := decoder.Decode(&jsonDenebBlockContents); err != nil {
|
if err := decoder.Decode(&jsonDenebBlock); err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to decode blinded deneb block response json")
|
return nil, errors.Wrap(err, "failed to decode blinded deneb block response json")
|
||||||
}
|
}
|
||||||
genericBlock, err := jsonDenebBlockContents.ToGeneric()
|
genericBlock, err := jsonDenebBlock.ToGeneric()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to get blinded deneb block")
|
return nil, errors.Wrap(err, "failed to get blinded deneb block")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -423,8 +423,8 @@ func TestGetBeaconBlock_DenebValid(t *testing.T) {
|
|||||||
ctrl := gomock.NewController(t)
|
ctrl := gomock.NewController(t)
|
||||||
defer ctrl.Finish()
|
defer ctrl.Finish()
|
||||||
|
|
||||||
proto := test_helpers.GenerateProtoDenebBeaconBlock()
|
proto := test_helpers.GenerateProtoDenebBeaconBlockContents()
|
||||||
block := test_helpers.GenerateJsonDenebBeaconBlock()
|
block := test_helpers.GenerateJsonDenebBeaconBlockContents()
|
||||||
bytes, err := json.Marshal(block)
|
bytes, err := json.Marshal(block)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
@@ -457,7 +457,7 @@ func TestGetBeaconBlock_DenebValid(t *testing.T) {
|
|||||||
|
|
||||||
expectedBeaconBlock := ðpb.GenericBeaconBlock{
|
expectedBeaconBlock := ðpb.GenericBeaconBlock{
|
||||||
Block: ðpb.GenericBeaconBlock_Deneb{
|
Block: ðpb.GenericBeaconBlock_Deneb{
|
||||||
Deneb: proto.Block,
|
Deneb: proto,
|
||||||
},
|
},
|
||||||
IsBlinded: false,
|
IsBlinded: false,
|
||||||
}
|
}
|
||||||
@@ -568,8 +568,8 @@ func TestGetBeaconBlock_FallbackToFullBlock(t *testing.T) {
|
|||||||
ctrl := gomock.NewController(t)
|
ctrl := gomock.NewController(t)
|
||||||
defer ctrl.Finish()
|
defer ctrl.Finish()
|
||||||
|
|
||||||
proto := test_helpers.GenerateProtoDenebBeaconBlock()
|
proto := test_helpers.GenerateProtoDenebBeaconBlockContents()
|
||||||
block := test_helpers.GenerateJsonDenebBeaconBlock()
|
block := test_helpers.GenerateJsonDenebBeaconBlockContents()
|
||||||
blockBytes, err := json.Marshal(block)
|
blockBytes, err := json.Marshal(block)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
@@ -617,7 +617,7 @@ func TestGetBeaconBlock_FallbackToFullBlock(t *testing.T) {
|
|||||||
|
|
||||||
expectedBeaconBlock := ðpb.GenericBeaconBlock{
|
expectedBeaconBlock := ðpb.GenericBeaconBlock{
|
||||||
Block: ðpb.GenericBeaconBlock_Deneb{
|
Block: ðpb.GenericBeaconBlock_Deneb{
|
||||||
Deneb: proto.Block,
|
Deneb: proto,
|
||||||
},
|
},
|
||||||
IsBlinded: false,
|
IsBlinded: false,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,10 +96,7 @@ func (c beaconApiValidatorClient) proposeBeaconBlock(ctx context.Context, in *et
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to compute block root for deneb beacon block")
|
return nil, errors.Wrap(err, "failed to compute block root for deneb beacon block")
|
||||||
}
|
}
|
||||||
// TODO: Fix this as part of beacon API PR
|
signedBlock, err := shared.SignedBeaconBlockContentsDenebFromConsensus(blockType.Deneb)
|
||||||
signedBlock, err := shared.SignedBeaconBlockContentsDenebFromConsensus(ðpb.SignedBeaconBlockAndBlobsDeneb{
|
|
||||||
Block: blockType.Deneb,
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "failed to convert deneb beacon block contents")
|
return nil, errors.Wrap(err, "failed to convert deneb beacon block contents")
|
||||||
}
|
}
|
||||||
@@ -110,19 +107,18 @@ func (c beaconApiValidatorClient) proposeBeaconBlock(ctx context.Context, in *et
|
|||||||
case *ethpb.GenericSignedBeaconBlock_BlindedDeneb:
|
case *ethpb.GenericSignedBeaconBlock_BlindedDeneb:
|
||||||
blinded = true
|
blinded = true
|
||||||
consensusVersion = "deneb"
|
consensusVersion = "deneb"
|
||||||
//TODO: update for beaocn API
|
beaconBlockRoot, err = blockType.BlindedDeneb.HashTreeRoot()
|
||||||
//beaconBlockRoot, err = blockType.BlindedDeneb.SignedBlindedBlock.HashTreeRoot()
|
if err != nil {
|
||||||
//if err != nil {
|
return nil, errors.Wrap(err, "failed to compute block root for blinded deneb beacon block")
|
||||||
// return nil, errors.Wrap(err, "failed to compute block root for blinded deneb beacon block")
|
}
|
||||||
//}
|
signedBlock, err := shared.SignedBlindedBeaconBlockDenebFromConsensus(blockType.BlindedDeneb)
|
||||||
//signedBlock, err := shared.SignedBlindedBeaconBlockContentsDenebFromConsensus(blockType.BlindedDeneb)
|
if err != nil {
|
||||||
//if err != nil {
|
return nil, errors.Wrap(err, "failed to convert blinded deneb beacon block contents")
|
||||||
// return nil, errors.Wrap(err, "failed to convert blinded deneb beacon block contents")
|
}
|
||||||
//}
|
marshalledSignedBeaconBlockJson, err = json.Marshal(signedBlock)
|
||||||
//marshalledSignedBeaconBlockJson, err = json.Marshal(signedBlock)
|
if err != nil {
|
||||||
//if err != nil {
|
return nil, errors.Wrap(err, "failed to marshal blinded deneb beacon block contents")
|
||||||
// return nil, errors.Wrap(err, "failed to marshal blinded deneb beacon block contents")
|
}
|
||||||
//}
|
|
||||||
default:
|
default:
|
||||||
return nil, errors.Errorf("unsupported block type %T", in.Block)
|
return nil, errors.Errorf("unsupported block type %T", in.Block)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ func TestProposeBeaconBlock_BlindedDeneb(t *testing.T) {
|
|||||||
defer ctrl.Finish()
|
defer ctrl.Finish()
|
||||||
jsonRestHandler := mock.NewMockJsonRestHandler(ctrl)
|
jsonRestHandler := mock.NewMockJsonRestHandler(ctrl)
|
||||||
|
|
||||||
var blockContents shared.SignedBlindedBeaconBlockContentsDeneb
|
var block shared.SignedBlindedBeaconBlockDeneb
|
||||||
err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlockContents), &blockContents)
|
err := json.Unmarshal([]byte(rpctesting.BlindedDenebBlock), &block)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
genericSignedBlock, err := blockContents.ToGeneric()
|
genericSignedBlock, err := block.ToGeneric()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
denebBytes, err := json.Marshal(blockContents)
|
denebBytes, err := json.Marshal(block)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
// Make sure that what we send in the POST body is the marshalled version of the protobuf block
|
// Make sure that what we send in the POST body is the marshalled version of the protobuf block
|
||||||
headers := map[string]string{"Eth-Consensus-Version": "deneb"}
|
headers := map[string]string{"Eth-Consensus-Version": "deneb"}
|
||||||
@@ -43,7 +43,7 @@ func TestProposeBeaconBlock_BlindedDeneb(t *testing.T) {
|
|||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
require.NotNil(t, proposeResponse)
|
require.NotNil(t, proposeResponse)
|
||||||
|
|
||||||
expectedBlockRoot, err := genericSignedBlock.GetBlindedDeneb().SignedBlindedBlock.HashTreeRoot()
|
expectedBlockRoot, err := genericSignedBlock.GetBlindedDeneb().HashTreeRoot()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// Make sure that the block root is set
|
// Make sure that the block root is set
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -121,13 +121,31 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
genericSignedBlock, err := blk.PbGenericBlock()
|
var genericSignedBlock *ethpb.GenericSignedBeaconBlock
|
||||||
if err != nil {
|
if blk.Version() >= version.Deneb && !blk.IsBlinded() {
|
||||||
log.WithError(err).Error("Failed to create proposal request")
|
denebBlock, err := blk.PbDenebBlock()
|
||||||
if v.emitAccountMetrics {
|
if err != nil {
|
||||||
ValidatorProposeFailVec.WithLabelValues(fmtKey).Inc()
|
log.WithError(err).Error("Failed to get deneb block")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
genericSignedBlock = ðpb.GenericSignedBeaconBlock{
|
||||||
|
Block: ðpb.GenericSignedBeaconBlock_Deneb{
|
||||||
|
Deneb: ðpb.SignedBeaconBlockContentsDeneb{
|
||||||
|
Block: denebBlock,
|
||||||
|
KzgProofs: b.GetDeneb().KzgProofs,
|
||||||
|
Blobs: b.GetDeneb().Blobs,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
genericSignedBlock, err = blk.PbGenericBlock()
|
||||||
|
if err != nil {
|
||||||
|
log.WithError(err).Error("Failed to create proposal request")
|
||||||
|
if v.emitAccountMetrics {
|
||||||
|
ValidatorProposeFailVec.WithLabelValues(fmtKey).Inc()
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
blkResp, err := v.validatorClient.ProposeBeaconBlock(ctx, genericSignedBlock)
|
blkResp, err := v.validatorClient.ProposeBeaconBlock(ctx, genericSignedBlock)
|
||||||
|
|||||||
@@ -587,10 +587,10 @@ func testProposeBlock(t *testing.T, graffiti []byte) {
|
|||||||
version: version.Deneb,
|
version: version.Deneb,
|
||||||
block: ðpb.GenericBeaconBlock{
|
block: ðpb.GenericBeaconBlock{
|
||||||
Block: ðpb.GenericBeaconBlock_Deneb{
|
Block: ðpb.GenericBeaconBlock_Deneb{
|
||||||
Deneb: func() *ethpb.BeaconBlockDeneb {
|
Deneb: func() *ethpb.BeaconBlockContentsDeneb {
|
||||||
blk := util.NewBeaconBlockDeneb()
|
blk := util.NewBeaconBlockContentsDeneb()
|
||||||
blk.Block.Body.Graffiti = graffiti
|
blk.Block.Block.Body.Graffiti = graffiti
|
||||||
return blk.Block
|
return ðpb.BeaconBlockContentsDeneb{Block: blk.Block.Block, KzgProofs: blk.KzgProofs, Blobs: blk.Blobs}
|
||||||
}(),
|
}(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -600,12 +600,10 @@ func testProposeBlock(t *testing.T, graffiti []byte) {
|
|||||||
version: version.Deneb,
|
version: version.Deneb,
|
||||||
block: ðpb.GenericBeaconBlock{
|
block: ðpb.GenericBeaconBlock{
|
||||||
Block: ðpb.GenericBeaconBlock_BlindedDeneb{
|
Block: ðpb.GenericBeaconBlock_BlindedDeneb{
|
||||||
BlindedDeneb: func() *ethpb.BlindedBeaconBlockAndBlobsDeneb {
|
BlindedDeneb: func() *ethpb.BlindedBeaconBlockDeneb {
|
||||||
blk := util.NewBlindedBeaconBlockDeneb()
|
blk := util.NewBlindedBeaconBlockDeneb()
|
||||||
blk.Message.Body.Graffiti = graffiti
|
blk.Message.Body.Graffiti = graffiti
|
||||||
return ðpb.BlindedBeaconBlockAndBlobsDeneb{
|
return blk.Message
|
||||||
Block: blk.Message,
|
|
||||||
}
|
|
||||||
}(),
|
}(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user