mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 11:32:09 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
34 lines
789 B
Go
34 lines
789 B
Go
package sync
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed"
|
|
opfeed "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/feed/operation"
|
|
"github.com/prysmaticlabs/prysm/v5/consensus-types/blocks"
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
func (s *Service) blobSubscriber(ctx context.Context, msg proto.Message) error {
|
|
b, ok := msg.(blocks.VerifiedROBlob)
|
|
if !ok {
|
|
return fmt.Errorf("message was not type blocks.ROBlob, type=%T", msg)
|
|
}
|
|
|
|
s.setSeenBlobIndex(b.Slot(), b.ProposerIndex(), b.Index)
|
|
|
|
if err := s.cfg.chain.ReceiveBlob(ctx, b); err != nil {
|
|
return err
|
|
}
|
|
|
|
s.cfg.operationNotifier.OperationFeed().Send(&feed.Event{
|
|
Type: opfeed.BlobSidecarReceived,
|
|
Data: &opfeed.BlobSidecarReceivedData{
|
|
Blob: &b,
|
|
},
|
|
})
|
|
|
|
return nil
|
|
}
|