Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor issue in blsToExecChange message validator #13498

Merged
merged 2 commits into from Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion beacon-chain/p2p/message_id.go
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/sync/initial-sync/blocks_fetcher.go
Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions beacon-chain/sync/validate_bls_to_execution_change.go
Expand Up @@ -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
}
Expand Down