mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
Only Perform Initial Sync With a Single Peer (#2471)
* fix spacing * use send instead of broadcast in initial sync
This commit is contained in:
parent
f876df42d7
commit
629b76cf44
@ -63,7 +63,6 @@ func DefaultConfig() *Config {
|
||||
}
|
||||
|
||||
type p2pAPI interface {
|
||||
p2p.Broadcaster
|
||||
p2p.Sender
|
||||
Subscribe(msg proto.Message, channel chan p2p.Message) event.Subscription
|
||||
}
|
||||
|
@ -117,10 +117,12 @@ func (s *InitialSync) requestBatchedBlocks(startSlot uint64, endSlot uint64) {
|
||||
"slotSlot": startSlot - params.BeaconConfig().GenesisSlot,
|
||||
"endSlot": endSlot - params.BeaconConfig().GenesisSlot},
|
||||
).Debug("Requesting batched blocks")
|
||||
s.p2p.Broadcast(ctx, &pb.BatchedBeaconBlockRequest{
|
||||
if err := s.p2p.Send(ctx, &pb.BatchedBeaconBlockRequest{
|
||||
StartSlot: startSlot,
|
||||
EndSlot: endSlot,
|
||||
})
|
||||
}, s.bestPeer); err != nil {
|
||||
log.Errorf("Could not send batch block request to peer %s: %v", s.bestPeer.Pretty(), err)
|
||||
}
|
||||
}
|
||||
|
||||
// validateAndSaveNextBlock will validate whether blocks received from the blockfetcher
|
||||
|
Loading…
Reference in New Issue
Block a user