2021-09-09 03:25:02 +00:00
|
|
|
package sync
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/pkg/errors"
|
2022-08-16 12:20:13 +00:00
|
|
|
ethpb "github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1"
|
2021-09-09 03:25:02 +00:00
|
|
|
"google.golang.org/protobuf/proto"
|
|
|
|
)
|
|
|
|
|
2021-09-10 02:36:31 +00:00
|
|
|
// skipcq: SCC-U1000
|
2021-09-09 03:25:02 +00:00
|
|
|
func (s *Service) syncCommitteeMessageSubscriber(_ context.Context, msg proto.Message) error {
|
|
|
|
m, ok := msg.(*ethpb.SyncCommitteeMessage)
|
|
|
|
if !ok {
|
2022-11-07 16:44:38 +00:00
|
|
|
return fmt.Errorf("message was not type *ethpb.SyncCommitteeMessage, type=%T", msg)
|
2021-09-09 03:25:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if m == nil {
|
|
|
|
return errors.New("nil sync committee message")
|
|
|
|
}
|
|
|
|
|
2021-11-05 19:08:58 +00:00
|
|
|
return s.cfg.syncCommsPool.SaveSyncCommitteeMessage(m)
|
2021-09-09 03:25:02 +00:00
|
|
|
}
|