mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 07:58:22 -05:00
Lock around validateBeaconBlockPubSub (#3567)
This commit is contained in:
@@ -66,6 +66,7 @@ type RegularSync struct {
|
||||
pendingQueueLock sync.RWMutex
|
||||
chainStarted bool
|
||||
initialSync Checker
|
||||
validateBlockLock sync.RWMutex
|
||||
}
|
||||
|
||||
// Start the regular sync service.
|
||||
|
||||
@@ -19,6 +19,8 @@ var recentlySeenRoots = ccache.New(ccache.Configure().MaxSize(100000))
|
||||
// Blocks that have already been seen are ignored. If the BLS signature is any valid signature,
|
||||
// this method rebroadcasts the message.
|
||||
func (r *RegularSync) validateBeaconBlockPubSub(ctx context.Context, msg proto.Message, p p2p.Broadcaster, fromSelf bool) bool {
|
||||
r.validateBlockLock.Lock()
|
||||
defer r.validateBlockLock.Unlock()
|
||||
m := msg.(*ethpb.BeaconBlock)
|
||||
|
||||
blockRoot, err := ssz.SigningRoot(m)
|
||||
|
||||
Reference in New Issue
Block a user