mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
Fix minor issue in blsToExecChange validator (#13498)
Co-authored-by: Nishant Das <nishdas93@gmail.com>
This commit is contained in:
parent
8dd5e96b29
commit
4e24102237
@ -83,7 +83,7 @@ func postAltairMsgID(pmsg *pubsubpb.Message, fEpoch primitives.Epoch) string {
|
||||
decodedData, err := encoder.DecodeSnappy(pmsg.Data, gossipPubSubSize)
|
||||
if err != nil {
|
||||
totalLength, err := math.AddInt(
|
||||
len(params.BeaconConfig().MessageDomainValidSnappy),
|
||||
len(params.BeaconConfig().MessageDomainInvalidSnappy),
|
||||
len(topicLenBytes),
|
||||
topicLen,
|
||||
len(pmsg.Data),
|
||||
|
@ -517,7 +517,7 @@ func (f *blocksFetcher) requestBlobs(ctx context.Context, req *p2ppb.BlobSidecar
|
||||
"capacity": f.rateLimiter.Remaining(pid.String()),
|
||||
"score": f.p2p.Peers().Scorers().BlockProviderScorer().FormatScorePretty(pid),
|
||||
}).Debug("Requesting blobs")
|
||||
// We're intentionally abusing the block rate limit here, treating blob requests as if they were blob requests.
|
||||
// We're intentionally abusing the block rate limit here, treating blob requests as if they were block requests.
|
||||
// Since blob requests take more bandwidth than blocks, we should improve how we account for the different kinds
|
||||
// of requests, more in proportion to the cost of serving them.
|
||||
if f.rateLimiter.Remaining(pid.String()) < int64(req.Count) {
|
||||
|
@ -38,6 +38,9 @@ func (s *Service) validateBlsToExecutionChange(ctx context.Context, pid peer.ID,
|
||||
}
|
||||
|
||||
// Check that the validator hasn't submitted a previous execution change.
|
||||
if blsChange.Message == nil {
|
||||
return pubsub.ValidationReject, errNilMessage
|
||||
}
|
||||
if s.cfg.blsToExecPool.ValidatorExists(blsChange.Message.ValidatorIndex) {
|
||||
return pubsub.ValidationIgnore, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user