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